pub struct VecMap<K: MoveType, V: MoveType> {
pub contents: MoveVec<Entry<K, V>>,
}
Expand description
A map data structure backed by a vector. The map is guaranteed not to contain duplicate keys, but entries are not sorted by key–entries are included in insertion order. All operations are O(N) in the size of the map–the intention of this data structure is only to provide the convenience of programming against a map API. Large maps should use handwritten parent/child relationships instead. Maps that need sorted iteration rather than insertion order iteration should also be handwritten.
Fields§
§contents: MoveVec<Entry<K, V>>
Implementations§
Trait Implementations§
Source§impl<'de, K: MoveType, V: MoveType> Deserialize<'de> for VecMap<K, V>
impl<'de, K: MoveType, V: MoveType> Deserialize<'de> for VecMap<K, V>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<K: MoveType, V: MoveType> MoveStruct for VecMap<K, V>
impl<K: MoveType, V: MoveType> MoveStruct for VecMap<K, V>
type StructTag = VecMapTypeTag<K, V>
Source§impl<K: MoveType, V: MoveType> MoveType for VecMap<K, V>
impl<K: MoveType, V: MoveType> MoveType for VecMap<K, V>
Source§impl<K: MoveType, V: MoveType> StaticModule for VecMap<K, V>
impl<K: MoveType, V: MoveType> StaticModule for VecMap<K, V>
fn module() -> Identifier
Source§impl<K: MoveType, V: MoveType> StaticName for VecMap<K, V>
impl<K: MoveType, V: MoveType> StaticName for VecMap<K, V>
fn name() -> Identifier
Source§impl<K: MoveType + StaticTypeTag, V: MoveType + StaticTypeTag> StaticTypeParams for VecMap<K, V>
impl<K: MoveType + StaticTypeTag, V: MoveType + StaticTypeTag> StaticTypeParams for VecMap<K, V>
fn type_params() -> Vec<TypeTag>
impl<K: Eq + MoveType, V: Eq + MoveType> Eq for VecMap<K, V>
impl<K: MoveType, V: MoveType> 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