pub struct TokenAttributesMapper<SA, A = CurrentStorage>where
SA: StorageMapperApi,{ /* private fields */ }
Implementations§
Source§impl<SA> TokenAttributesMapper<SA, CurrentStorage>where
SA: StorageMapperApi,
impl<SA> TokenAttributesMapper<SA, CurrentStorage>where
SA: StorageMapperApi,
pub fn set<T: TopEncode + TopDecode + NestedEncode + NestedDecode, M: ManagedTypeApi>( &self, token_id: &TokenIdentifier<M>, token_nonce: u64, attributes: &T, )
Sourcepub fn update<T: TopEncode + TopDecode + NestedEncode + NestedDecode, M: ManagedTypeApi>(
&self,
token_id: &TokenIdentifier<M>,
token_nonce: u64,
attributes: &T,
)
pub fn update<T: TopEncode + TopDecode + NestedEncode + NestedDecode, M: ManagedTypeApi>( &self, token_id: &TokenIdentifier<M>, token_nonce: u64, attributes: &T, )
Use carefully. Update should be used mainly when backed up by the protocol.
pub fn clear<T: TopEncode + TopDecode + NestedEncode + NestedDecode, M: ManagedTypeApi>( &self, token_id: &TokenIdentifier<M>, token_nonce: u64, )
Source§impl<SA, A> TokenAttributesMapper<SA, A>where
SA: StorageMapperApi,
A: StorageAddress<SA>,
impl<SA, A> TokenAttributesMapper<SA, A>where
SA: StorageMapperApi,
A: StorageAddress<SA>,
pub fn has_attributes<M: ManagedTypeApi>( &self, token_id: &TokenIdentifier<M>, token_nonce: u64, ) -> bool
pub fn has_nonce<T: TopEncode + TopDecode + NestedEncode + NestedDecode, M: ManagedTypeApi>( &self, token_id: &TokenIdentifier<M>, attr: &T, ) -> bool
pub fn get_attributes<T: TopEncode + TopDecode + NestedEncode + NestedDecode, M: ManagedTypeApi>( &self, token_id: &TokenIdentifier<M>, token_nonce: u64, ) -> T
pub fn get_nonce<T: TopEncode + TopDecode + NestedEncode + NestedDecode, M: ManagedTypeApi>( &self, token_id: &TokenIdentifier<M>, attr: &T, ) -> u64
Trait Implementations§
Source§impl<SA> StorageMapper<SA> for TokenAttributesMapper<SA, CurrentStorage>where
SA: StorageMapperApi,
impl<SA> StorageMapper<SA> for TokenAttributesMapper<SA, CurrentStorage>where
SA: StorageMapperApi,
Source§fn new(base_key: StorageKey<SA>) -> Self
fn new(base_key: StorageKey<SA>) -> Self
Will be called automatically by the
#[storage_mapper]
annotation generated code.Source§impl<SA> StorageMapperFromAddress<SA> for TokenAttributesMapper<SA, ManagedAddress<SA>>where
SA: StorageMapperApi,
impl<SA> StorageMapperFromAddress<SA> for TokenAttributesMapper<SA, ManagedAddress<SA>>where
SA: StorageMapperApi,
Source§fn new_from_address(
address: ManagedAddress<SA>,
base_key: StorageKey<SA>,
) -> Self
fn new_from_address( address: ManagedAddress<SA>, base_key: StorageKey<SA>, ) -> Self
Will be called automatically by the
#[storage_mapper_from_address]
annotation generated code.Auto Trait Implementations§
impl<SA, A> Freeze for TokenAttributesMapper<SA, A>
impl<SA, A> RefUnwindSafe for TokenAttributesMapper<SA, A>where
A: RefUnwindSafe,
SA: RefUnwindSafe,
<SA as HandleTypeInfo>::ManagedBufferHandle: RefUnwindSafe,
impl<SA, A> Send for TokenAttributesMapper<SA, A>
impl<SA, A> Sync for TokenAttributesMapper<SA, A>
impl<SA, A> Unpin for TokenAttributesMapper<SA, A>
impl<SA, A> UnwindSafe for TokenAttributesMapper<SA, A>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more