pub struct TokenAttributesMapper<SA, A = CurrentStorage>where
SA: StorageMapperApi,{ /* private fields */ }
Implementations§
Source§impl<SA> TokenAttributesMapper<SA>where
SA: StorageMapperApi,
impl<SA> TokenAttributesMapper<SA>where
SA: StorageMapperApi,
pub fn set<T, M>( &self, token_id: &TokenIdentifier<M>, token_nonce: u64, attributes: &T, )
Sourcepub fn update<T, M>(
&self,
token_id: &TokenIdentifier<M>,
token_nonce: u64,
attributes: &T,
)
pub fn update<T, M>( &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, M>(&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>(
&self,
token_id: &TokenIdentifier<M>,
token_nonce: u64,
) -> boolwhere
M: ManagedTypeApi,
pub fn has_nonce<T, M>(&self, token_id: &TokenIdentifier<M>, attr: &T) -> bool
pub fn get_attributes<T, M>( &self, token_id: &TokenIdentifier<M>, token_nonce: u64, ) -> T
pub fn get_nonce<T, M>(&self, token_id: &TokenIdentifier<M>, attr: &T) -> u64
Trait Implementations§
Source§impl<SA> StorageMapper<SA> for TokenAttributesMapper<SA>where
SA: StorageMapperApi,
impl<SA> StorageMapper<SA> for TokenAttributesMapper<SA>where
SA: StorageMapperApi,
Source§fn new(base_key: StorageKey<SA>) -> TokenAttributesMapper<SA>
fn new(base_key: StorageKey<SA>) -> TokenAttributesMapper<SA>
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>,
) -> TokenAttributesMapper<SA, ManagedAddress<SA>>
fn new_from_address( address: ManagedAddress<SA>, base_key: StorageKey<SA>, ) -> TokenAttributesMapper<SA, ManagedAddress<SA>>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> InterpretableFrom<T> for T
impl<T> InterpretableFrom<T> for T
fn interpret_from(from: T, _context: &InterpreterContext) -> T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more