pub struct VecMap<K: AnchorSerialize + AnchorDeserialize + Clone, V: AnchorSerialize + AnchorDeserialize + Clone> { /* private fields */ }
Implementations§
source§impl<K: AnchorSerialize + AnchorDeserialize + Clone + PartialEq, V: AnchorSerialize + AnchorDeserialize + Clone> VecMap<K, V>
impl<K: AnchorSerialize + AnchorDeserialize + Clone + PartialEq, V: AnchorSerialize + AnchorDeserialize + Clone> VecMap<K, V>
pub fn new() -> Self
pub fn into_inner(self) -> Vec<(K, V)>
pub fn insert(&mut self, key: K, value: V)
pub fn get(&self, key: &K) -> Option<&V>
pub fn get_mut(&mut self, key: &K) -> Option<&mut V>
pub fn iter(&self) -> Iter<'_, (K, V)>
pub fn iter_mut(&mut self) -> IterMut<'_, (K, V)>
pub fn remove(&mut self, key: &K)
Trait Implementations§
source§impl<K: AnchorSerialize + AnchorDeserialize + Clone, V: AnchorSerialize + AnchorDeserialize + Clone> BorshDeserialize for VecMap<K, V>
impl<K: AnchorSerialize + AnchorDeserialize + Clone, V: AnchorSerialize + AnchorDeserialize + Clone> BorshDeserialize for VecMap<K, V>
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
source§impl<K: AnchorSerialize + AnchorDeserialize + Clone, V: AnchorSerialize + AnchorDeserialize + Clone> BorshSerialize for VecMap<K, V>
impl<K: AnchorSerialize + AnchorDeserialize + Clone, V: AnchorSerialize + AnchorDeserialize + Clone> BorshSerialize for VecMap<K, V>
source§impl<K: Clone + AnchorSerialize + AnchorDeserialize + Clone, V: Clone + AnchorSerialize + AnchorDeserialize + Clone> Clone for VecMap<K, V>
impl<K: Clone + AnchorSerialize + AnchorDeserialize + Clone, V: Clone + AnchorSerialize + AnchorDeserialize + Clone> Clone for VecMap<K, V>
source§impl<K: AnchorSerialize + AnchorDeserialize + Clone, V: AnchorSerialize + AnchorDeserialize + Clone> From<&HashMap<K, V>> for VecMap<K, V>
impl<K: AnchorSerialize + AnchorDeserialize + Clone, V: AnchorSerialize + AnchorDeserialize + Clone> From<&HashMap<K, V>> for VecMap<K, V>
source§impl<K: AnchorSerialize + AnchorDeserialize + Clone, V: AnchorSerialize + AnchorDeserialize + Clone> From<HashMap<K, V>> for VecMap<K, V>
impl<K: AnchorSerialize + AnchorDeserialize + Clone, V: AnchorSerialize + AnchorDeserialize + Clone> From<HashMap<K, V>> for VecMap<K, V>
source§impl<K: AnchorSerialize + AnchorDeserialize + Clone, V: AnchorSerialize + AnchorDeserialize + Clone> FromIterator<(K, V)> for VecMap<K, V>
impl<K: AnchorSerialize + AnchorDeserialize + Clone, V: AnchorSerialize + AnchorDeserialize + Clone> FromIterator<(K, V)> for VecMap<K, V>
source§impl<K: AnchorSerialize + AnchorDeserialize + Clone, V: AnchorSerialize + AnchorDeserialize + Clone> IntoIterator for VecMap<K, V>
impl<K: AnchorSerialize + AnchorDeserialize + Clone, V: AnchorSerialize + AnchorDeserialize + Clone> IntoIterator for VecMap<K, V>
source§impl<K: PartialEq + AnchorSerialize + AnchorDeserialize + Clone, V: PartialEq + AnchorSerialize + AnchorDeserialize + Clone> PartialEq for VecMap<K, V>
impl<K: PartialEq + AnchorSerialize + AnchorDeserialize + Clone, V: PartialEq + AnchorSerialize + AnchorDeserialize + Clone> PartialEq for VecMap<K, V>
source§impl<K: AnchorSerialize + AnchorDeserialize + Clone + ToNode, V: AnchorSerialize + AnchorDeserialize + Clone + ToNode> ToNode for VecMap<K, V>
impl<K: AnchorSerialize + AnchorDeserialize + Clone + ToNode, V: AnchorSerialize + AnchorDeserialize + Clone + ToNode> ToNode for VecMap<K, V>
source§impl<K: AnchorSerialize + AnchorDeserialize + Clone + ToSchema + PartialEq, V: AnchorSerialize + AnchorDeserialize + Clone + ToSchema> ToSchema for VecMap<K, V>
impl<K: AnchorSerialize + AnchorDeserialize + Clone + ToSchema + PartialEq, V: AnchorSerialize + AnchorDeserialize + Clone + ToSchema> ToSchema for VecMap<K, V>
fn schema() -> Schema
fn schema_value(&self) -> SchemaValue
impl<K: AnchorSerialize + AnchorDeserialize + Clone, V: AnchorSerialize + AnchorDeserialize + Clone> StructuralPartialEq for VecMap<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for VecMap<K, V>
impl<K, V> RefUnwindSafe for VecMap<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for VecMap<K, V>
impl<K, V> Sync for VecMap<K, V>
impl<K, V> Unpin for VecMap<K, V>
impl<K, V> UnwindSafe for VecMap<K, V>where
K: UnwindSafe,
V: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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