pub struct ArchivedBTreeMap<K, V> { /* private fields */ }
Expand description

An archived BTreeMap.

Implementations§

source§

impl<K, V> ArchivedBTreeMap<K, V>

source

pub fn contains_key<Q: Ord + ?Sized>(&self, key: &Q) -> boolwhere K: Borrow<Q> + Ord,

Returns true if the map contains a value for the specified key.

The key may be any borrowed form of the map’s key type, but the ordering on the borrowed form must match the ordering on the key type.

source

pub fn get<Q: Ord + ?Sized>(&self, key: &Q) -> Option<&V>where K: Borrow<Q> + Ord,

Returns a reference to the value corresponding to the key.

The key may be any borrowed form of the map’s key type, but the ordering on the borrowed form must match the ordering on the key type.

source

pub fn get_key_value<Q: Ord + ?Sized>(&self, k: &Q) -> Option<(&K, &V)>where K: Borrow<Q> + Ord,

Returns the key-value pair corresponding to the supplied key.

The supplied key may be any borrowed form of the map’s key type, but the ordering on the borrowed form must match the ordering on the key type.

source

pub fn is_empty(&self) -> bool

Returns true if the map contains no elements.

source

pub fn iter(&self) -> Iter<'_, K, V>

Gets an iterator over the entries of the map, sorted by key.

source

pub fn keys(&self) -> Keys<'_, K, V>

Gets an iterator over the keys of the map, in sorted order.

source

pub fn len(&self) -> usize

Returns the number of items in the archived B-tree map.

source

pub fn values(&self) -> Values<'_, K, V>

Gets an iterator over the values of the map, in order by key.

source

pub unsafe fn resolve_from_len( len: usize, pos: usize, resolver: BTreeMapResolver, out: *mut Self )

Resolves a B-tree map from its length.

Safety
  • len must be the number of elements that were serialized
  • pos must be the position of out within the archive
  • resolver must be the result of serializing a B-tree map
source§

impl<K, V> ArchivedBTreeMap<K, V>

source

pub unsafe fn serialize_from_reverse_iter<'a, UK, UV, S, I>( iter: I, serializer: &mut S ) -> Result<BTreeMapResolver, S::Error>where UK: 'a + Serialize<S, Archived = K>, UV: 'a + Serialize<S, Archived = V>, S: Serializer + ?Sized, I: ExactSizeIterator<Item = (&'a UK, &'a UV)>,

Serializes an ordered iterator of key-value pairs as a B-tree map.

Safety
  • Keys returned by the iterator must be unique
  • Keys must be in reverse sorted order from last to first

Trait Implementations§

source§

impl<K, V, C> CheckBytes<C> for ArchivedBTreeMap<K, V>where K: CheckBytes<C> + Ord, V: CheckBytes<C>, C: ArchiveContext + ?Sized, C::Error: Error,

§

type Error = ArchivedBTreeMapError<<K as CheckBytes<C>>::Error, <V as CheckBytes<C>>::Error, <C as Fallible>::Error>

The error that may result from checking the type.
source§

unsafe fn check_bytes<'a>( value: *const Self, context: &mut C ) -> Result<&'a Self, Self::Error>

Checks whether the given pointer points to a valid value within the given context. Read more
source§

impl<K: Debug, V: Debug> Debug for ArchivedBTreeMap<K, V>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<K: Archive + Ord, V: Archive, D: Fallible + ?Sized> Deserialize<BTreeMap<K, V, Global>, D> for ArchivedBTreeMap<K::Archived, V::Archived>where K::Archived: Deserialize<K, D> + Ord, V::Archived: Deserialize<V, D>,

source§

fn deserialize(&self, deserializer: &mut D) -> Result<BTreeMap<K, V>, D::Error>

Deserializes using the given deserializer
source§

impl<K: Hash, V: Hash> Hash for ArchivedBTreeMap<K, V>

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<K, Q, V> Index<&Q> for ArchivedBTreeMap<K, V>where K: Borrow<Q> + Ord, Q: Ord + ?Sized,

§

type Output = V

The returned type after indexing.
source§

fn index(&self, key: &Q) -> &V

Performs the indexing (container[index]) operation. Read more
source§

impl<'a, K, V> IntoIterator for &'a ArchivedBTreeMap<K, V>

§

type Item = (&'a K, &'a V)

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, K, V>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<K: Ord, V: Ord> Ord for ArchivedBTreeMap<K, V>

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl<K, V, AK: PartialEq<K>, AV: PartialEq<V>> PartialEq<ArchivedBTreeMap<AK, AV>> for BTreeMap<K, V>

source§

fn eq(&self, other: &ArchivedBTreeMap<AK, AV>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<K: PartialEq, V: PartialEq> PartialEq<ArchivedBTreeMap<K, V>> for ArchivedBTreeMap<K, V>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<K, V, AK: PartialEq<K>, AV: PartialEq<V>> PartialEq<BTreeMap<K, V, Global>> for ArchivedBTreeMap<AK, AV>

source§

fn eq(&self, other: &BTreeMap<K, V>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<K: PartialOrd, V: PartialOrd> PartialOrd<ArchivedBTreeMap<K, V>> for ArchivedBTreeMap<K, V>

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<K: Eq, V: Eq> Eq for ArchivedBTreeMap<K, V>

Auto Trait Implementations§

§

impl<K, V> RefUnwindSafe for ArchivedBTreeMap<K, V>where K: RefUnwindSafe, V: RefUnwindSafe,

§

impl<K, V> Send for ArchivedBTreeMap<K, V>where K: Send, V: Send,

§

impl<K, V> Sync for ArchivedBTreeMap<K, V>where K: Sync, V: Sync,

§

impl<K, V> !Unpin for ArchivedBTreeMap<K, V>

§

impl<K, V> UnwindSafe for ArchivedBTreeMap<K, V>where K: UnwindSafe, V: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CallHasher for Twhere T: Hash + ?Sized,

§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64where H: Hash + ?Sized, B: BuildHasher,

source§

impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

source§

fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> LayoutRaw for T

source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
source§

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.