pub struct TdfMap<K: MapKey, V: Codec> { /* private fields */ }
Expand description

Structure for Tdf maps these are maps that are created from two Vec so they retain insertion order but are slow for lookups. This implementation guarantees the lengths of both lists are the same

Implementations

Creates a new empty TdfMap

Creates a new empty TdfMap sized to account for the provided capacity of contents

Insert a new entry into the map

Inserts multiple entries from an iterable value (i.e. Vec / slice of key value tuples)

Removes a value by its key and returns the entry that was present at that position.

Returns the value stored at the provided key if its present or None.

Takes the value stored at the provided key out of the map taking ownership this also removes the key.

Iterator access for the map keys

Iterator access for the map values

Returns the length of this map

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Function for implementing encoding of Self to the provided vec of bytes Read more
Function for implementing decoding of Self from the provided Reader. Will return None if self cannot be decoded Read more
Optional additional specifier for Tdf types that tells which type this is Read more
Function to provide functionality for skipping this data type (e.g. read the bytes without using them) Read more
Shortcut function for encoding self directly to a Vec of bytes Read more
Formats the value using the given formatter. Read more

Implementation for converting a HashMap to a TdfMap by taking all its keys and values and building lists for the TdfMap

Converts to this type from the input type.
The type of the elements being iterated over.
Which kind of iterator are we turning this into?
Creates an iterator from a value. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.