pub struct AddressToIdMapper<SA, A = CurrentStorage>where
SA: StorageMapperApi,
A: StorageAddress<SA>,{ /* private fields */ }
Implementations§
Source§impl<SA, A> AddressToIdMapper<SA, A>where
SA: StorageMapperApi,
A: StorageAddress<SA>,
impl<SA, A> AddressToIdMapper<SA, A>where
SA: StorageMapperApi,
A: StorageAddress<SA>,
pub fn contains_id(&self, id: AddressId) -> bool
pub fn get_id(&self, address: &ManagedAddress<SA>) -> AddressId
pub fn get_id_non_zero(&self, address: &ManagedAddress<SA>) -> AddressId
pub fn get_address(&self, id: AddressId) -> Option<ManagedAddress<SA>>
pub fn get_last_id(&self) -> AddressId
Source§impl<SA> AddressToIdMapper<SA, CurrentStorage>where
SA: StorageMapperApi,
impl<SA> AddressToIdMapper<SA, CurrentStorage>where
SA: StorageMapperApi,
pub fn get_id_or_insert(&self, address: &ManagedAddress<SA>) -> AddressId
pub fn insert_new(&self, address: &ManagedAddress<SA>) -> AddressId
pub fn remove_by_id(&self, id: AddressId) -> Option<ManagedAddress<SA>>
pub fn remove_by_address(&self, address: &ManagedAddress<SA>) -> AddressId
Trait Implementations§
Source§impl<SA> StorageMapper<SA> for AddressToIdMapper<SA>where
SA: StorageMapperApi,
impl<SA> StorageMapper<SA> for AddressToIdMapper<SA>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 AddressToIdMapper<SA, ManagedAddress<SA>>where
SA: StorageMapperApi,
impl<SA> StorageMapperFromAddress<SA> for AddressToIdMapper<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 AddressToIdMapper<SA, A>
impl<SA, A> RefUnwindSafe for AddressToIdMapper<SA, A>where
A: RefUnwindSafe,
SA: RefUnwindSafe,
<SA as HandleTypeInfo>::ManagedBufferHandle: RefUnwindSafe,
impl<SA, A> Send for AddressToIdMapper<SA, A>
impl<SA, A> Sync for AddressToIdMapper<SA, A>
impl<SA, A> Unpin for AddressToIdMapper<SA, A>
impl<SA, A> UnwindSafe for AddressToIdMapper<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