#[repr(C)]pub struct TokenMap {
pub data: [TokenMapEntry; 16],
pub padding: [u8; 0],
pub count: u32,
}Expand description
Fixed size map generated by the macro.
Fields§
§data: [TokenMapEntry; 16]§padding: [u8; 0]§count: u32Implementations§
Source§impl TokenMap
impl TokenMap
Sourcepub fn get(&self, key: &Pubkey) -> Option<&TokenConfig>
Available on crate features utils and treasury and gmsol-utils only.
pub fn get(&self, key: &Pubkey) -> Option<&TokenConfig>
utils and treasury and gmsol-utils only.Get.
Sourcepub fn get_entry_by_index(
&self,
idx: usize,
) -> Option<(&[u8; 32], &TokenConfig)>
Available on crate features utils and treasury and gmsol-utils only.
pub fn get_entry_by_index( &self, idx: usize, ) -> Option<(&[u8; 32], &TokenConfig)>
utils and treasury and gmsol-utils only.Get entry by index.
Sourcepub fn get_mut(&mut self, key: &Pubkey) -> Option<&mut TokenConfig>
Available on crate features utils and treasury and gmsol-utils only.
pub fn get_mut(&mut self, key: &Pubkey) -> Option<&mut TokenConfig>
utils and treasury and gmsol-utils only.Get mutable reference to the corresponding value.
Sourcepub fn insert(
&mut self,
key: &Pubkey,
value: TokenConfig,
) -> Option<TokenConfig>
Available on crate features utils and treasury and gmsol-utils only.
pub fn insert( &mut self, key: &Pubkey, value: TokenConfig, ) -> Option<TokenConfig>
utils and treasury and gmsol-utils only.Insert.
Sourcepub fn insert_with_options(
&mut self,
key: &Pubkey,
value: TokenConfig,
new: bool,
) -> Result<Option<TokenConfig>, Error>
Available on crate features utils and treasury and gmsol-utils only.
pub fn insert_with_options( &mut self, key: &Pubkey, value: TokenConfig, new: bool, ) -> Result<Option<TokenConfig>, Error>
utils and treasury and gmsol-utils only.Insert with options.
Sourcepub fn remove(&mut self, key: &Pubkey) -> Option<TokenConfig>
Available on crate features utils and treasury and gmsol-utils only.
pub fn remove(&mut self, key: &Pubkey) -> Option<TokenConfig>
utils and treasury and gmsol-utils only.Remove.
Sourcepub fn len(&self) -> usize
Available on crate features utils and treasury and gmsol-utils only.
pub fn len(&self) -> usize
utils and treasury and gmsol-utils only.Get length.
Sourcepub fn is_empty(&self) -> bool
Available on crate features utils and treasury and gmsol-utils only.
pub fn is_empty(&self) -> bool
utils and treasury and gmsol-utils only.Is empty.
Sourcepub fn entries(&self) -> impl Iterator<Item = (&[u8; 32], &TokenConfig)>
Available on crate features utils and treasury and gmsol-utils only.
pub fn entries(&self) -> impl Iterator<Item = (&[u8; 32], &TokenConfig)>
utils and treasury and gmsol-utils only.Entries.
Sourcepub fn entries_mut(
&mut self,
) -> impl Iterator<Item = (&[u8; 32], &mut TokenConfig)>
Available on crate features utils and treasury and gmsol-utils only.
pub fn entries_mut( &mut self, ) -> impl Iterator<Item = (&[u8; 32], &mut TokenConfig)>
utils and treasury and gmsol-utils only.Entries with mutable access.
Trait Implementations§
Source§impl InitSpace for TokenMap
Available on crate features gmsol-utils and treasury and utils only.
impl InitSpace for TokenMap
Available on crate features
gmsol-utils and treasury and utils only.Source§const INIT_SPACE: usize = 1_556usize
const INIT_SPACE: usize = 1_556usize
Init Space.
impl Copy for TokenMap
impl Pod for TokenMap
Auto Trait Implementations§
impl Freeze for TokenMap
impl RefUnwindSafe for TokenMap
impl Send for TokenMap
impl Sync for TokenMap
impl Unpin for TokenMap
impl UnwindSafe for TokenMap
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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.