pub struct WhitelistMapper<SA, T, A = CurrentStorage>where
SA: StorageMapperApi,
A: StorageAddress<SA>,
T: NestedEncode + 'static,{ /* private fields */ }
Expand description
A non-iterable whitelist mapper. Very efficient for storing a whitelist, as each item requires only one storage key. If you need to iterate over the keys, use UnorderedSetMapper or SetMapper instead.
Implementations§
Source§impl<SA, T> WhitelistMapper<SA, T, ManagedAddress<SA>>
impl<SA, T> WhitelistMapper<SA, T, ManagedAddress<SA>>
Source§impl<SA, T> WhitelistMapper<SA, T>
impl<SA, T> WhitelistMapper<SA, T>
Trait Implementations§
Source§impl<SA, T> StorageMapper<SA> for WhitelistMapper<SA, T>where
SA: StorageMapperApi,
T: NestedEncode + 'static,
impl<SA, T> StorageMapper<SA> for WhitelistMapper<SA, T>where
SA: StorageMapperApi,
T: NestedEncode + 'static,
Source§fn new(base_key: StorageKey<SA>) -> WhitelistMapper<SA, T>
fn new(base_key: StorageKey<SA>) -> WhitelistMapper<SA, T>
Will be called automatically by the
#[storage_mapper]
annotation generated code.Source§impl<SA, T> StorageMapperFromAddress<SA> for WhitelistMapper<SA, T, ManagedAddress<SA>>where
SA: StorageMapperApi,
T: NestedEncode + 'static,
impl<SA, T> StorageMapperFromAddress<SA> for WhitelistMapper<SA, T, ManagedAddress<SA>>where
SA: StorageMapperApi,
T: NestedEncode + 'static,
Source§fn new_from_address(
address: ManagedAddress<SA>,
base_key: StorageKey<SA>,
) -> WhitelistMapper<SA, T, ManagedAddress<SA>>
fn new_from_address( address: ManagedAddress<SA>, base_key: StorageKey<SA>, ) -> WhitelistMapper<SA, T, ManagedAddress<SA>>
Will be called automatically by the
#[storage_mapper_from_address]
annotation generated code.Auto Trait Implementations§
impl<SA, T, A> Freeze for WhitelistMapper<SA, T, A>
impl<SA, T, A> RefUnwindSafe for WhitelistMapper<SA, T, A>where
A: RefUnwindSafe,
T: RefUnwindSafe,
<SA as HandleTypeInfo>::ManagedBufferHandle: RefUnwindSafe,
impl<SA, T, A> Send for WhitelistMapper<SA, T, A>
impl<SA, T, A> Sync for WhitelistMapper<SA, T, A>
impl<SA, T, A> Unpin for WhitelistMapper<SA, T, A>
impl<SA, T, A> UnwindSafe for WhitelistMapper<SA, T, 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> 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