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<KeyValue<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<'i>(&'i self) -> impl Iterator<Item = (&'i K, &'i V)>
pub fn iter_mut<'i>(&'i mut self) -> impl Iterator<Item = (&'i K, &'i mut 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>where
Vec<KeyValue<K, V>>: BorshDeserialize,
impl<K: AnchorSerialize + AnchorDeserialize + Clone, V: AnchorSerialize + AnchorDeserialize + Clone> BorshDeserialize for VecMap<K, V>where
Vec<KeyValue<K, V>>: BorshDeserialize,
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>where
Vec<KeyValue<K, V>>: BorshSerialize,
impl<K: AnchorSerialize + AnchorDeserialize + Clone, V: AnchorSerialize + AnchorDeserialize + Clone> BorshSerialize for VecMap<K, V>where
Vec<KeyValue<K, V>>: BorshSerialize,
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 + PartialEq, V: AnchorSerialize + AnchorDeserialize + Clone> FromIterator<(K, V)> for VecMap<K, V>
impl<K: AnchorSerialize + AnchorDeserialize + Clone + PartialEq, V: AnchorSerialize + AnchorDeserialize + Clone> FromIterator<(K, V)> for VecMap<K, V>
Source§impl<K, V> IntoIterator for VecMap<K, V>where
K: AnchorSerialize + AnchorDeserialize + Clone,
V: AnchorSerialize + AnchorDeserialize + Clone,
impl<K, V> IntoIterator for VecMap<K, V>where
K: AnchorSerialize + AnchorDeserialize + Clone,
V: AnchorSerialize + AnchorDeserialize + Clone,
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§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