//! Impl block has type parameters. use near_bindgen::near_bindgen; use borsh::{BorshDeserialize, BorshSerialize}; use std::marker::PhantomData; #[near_bindgen] #[derive(Default, BorshDeserialize, BorshSerialize)] struct Incrementer { value: u32, data: PhantomData, } #[near_bindgen] impl<'a, T: 'a + std::fmt::Display> Incrementer { pub fn inc(&mut self, by: u32) { self.value += by; } } fn main() {}