pub struct SinglePrefixMap<T>(pub Option<T>);Expand description
A mapping of the single prefix to a value. This essentially is a boolean value with a different interface.
Tuple Fields§
§0: Option<T>Implementations§
Source§impl<T> SinglePrefixMap<T>
impl<T> SinglePrefixMap<T>
Trait Implementations§
Source§impl<T: Clone> Clone for SinglePrefixMap<T>
impl<T: Clone> Clone for SinglePrefixMap<T>
Source§fn clone(&self) -> SinglePrefixMap<T>
fn clone(&self) -> SinglePrefixMap<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for SinglePrefixMap<T>
impl<T: Debug> Debug for SinglePrefixMap<T>
Source§impl<T> Default for SinglePrefixMap<T>
impl<T> Default for SinglePrefixMap<T>
Source§impl<'de, T> Deserialize<'de> for SinglePrefixMap<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for SinglePrefixMap<T>where
T: Deserialize<'de>,
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<T> FromIterator<(SinglePrefix, T)> for SinglePrefixMap<T>
impl<T> FromIterator<(SinglePrefix, T)> for SinglePrefixMap<T>
Source§fn from_iter<I: IntoIterator<Item = (SinglePrefix, T)>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = (SinglePrefix, T)>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl<T: Hash> Hash for SinglePrefixMap<T>
impl<T: Hash> Hash for SinglePrefixMap<T>
Source§impl<'a, T> IntoIterator for &'a SinglePrefixMap<T>
impl<'a, T> IntoIterator for &'a SinglePrefixMap<T>
Source§impl<T> IntoIterator for SinglePrefixMap<T>
impl<T> IntoIterator for SinglePrefixMap<T>
Source§impl<T: PartialEq> PartialEq for SinglePrefixMap<T>
impl<T: PartialEq> PartialEq for SinglePrefixMap<T>
Source§impl<T> PrefixMap<T> for SinglePrefixMap<T>
impl<T> PrefixMap<T> for SinglePrefixMap<T>
Source§type P = SinglePrefix
type P = SinglePrefix
The type of prefix
Source§type Iter<'a> = Zip<Repeat<&'a SinglePrefix>, IntoIter<&'a T>>
where
Self: 'a,
T: 'a
type Iter<'a> = Zip<Repeat<&'a SinglePrefix>, IntoIter<&'a T>> where Self: 'a, T: 'a
Type of
UnionSource§type Keys<'a> = RepeatN<&'a SinglePrefix>
where
T: 'a
type Keys<'a> = RepeatN<&'a SinglePrefix> where T: 'a
The type of iterator over the keys (prefixes)
Source§type Children<'a> = <SinglePrefixMap<T> as PrefixMap<T>>::Iter<'a>
where
Self: 'a,
T: 'a
type Children<'a> = <SinglePrefixMap<T> as PrefixMap<T>>::Iter<'a> where Self: 'a, T: 'a
The type of iterator over children of a given prefix.
Source§fn keys(&self) -> Self::Keys<'_>
fn keys(&self) -> Self::Keys<'_>
An iterator visiting all keys in arbitrary order. The iterator element type is
&'a Self::P.Source§fn values(&self) -> Self::Values<'_>
fn values(&self) -> Self::Values<'_>
An iterator visiting all values in arbitrary order. The iterator element type is
&'a T.Source§fn values_mut(&mut self) -> Self::ValuesMut<'_>
fn values_mut(&mut self) -> Self::ValuesMut<'_>
An iterator visiting all values mutablyin arbitrary order. The iterator element type is
&'a T.Source§fn children(&self, _prefix: &Self::P) -> Self::Children<'_>
fn children(&self, _prefix: &Self::P) -> Self::Children<'_>
An iterator visiting all keys and values of children of a given prefix. All children are
contained within that given prefix, or are equal.
Source§fn clear(&mut self)
fn clear(&mut self)
Clears the map, removing all key-value pairs. Keeps the allocated memory for reuse.
Source§fn get(&self, _: &Self::P) -> Option<&T>
fn get(&self, _: &Self::P) -> Option<&T>
Returns a reference to the value corresponding to the key.
Source§fn get_mut(&mut self, _: &Self::P) -> Option<&mut T>
fn get_mut(&mut self, _: &Self::P) -> Option<&mut T>
Returns a mutable reference to the value corresponding to the key.
Source§fn get_mut_or_default(&mut self, _: Self::P) -> &mut Twhere
T: Default,
fn get_mut_or_default(&mut self, _: Self::P) -> &mut Twhere
T: Default,
Returns a mutable reference to the value corresponding to the key. If the key does not exist
yet, create it using a default value.
Source§fn get_lpm(&self, k: &Self::P) -> Option<(&Self::P, &T)>
fn get_lpm(&self, k: &Self::P) -> Option<(&Self::P, &T)>
Returns a reference to the value corresponding to the longest prefix match of the key.
Source§fn contains_key(&self, _: &Self::P) -> bool
fn contains_key(&self, _: &Self::P) -> bool
Returns
true if the map contains a value for the specified key.Source§impl<T> Serialize for SinglePrefixMap<T>where
T: Serialize,
impl<T> Serialize for SinglePrefixMap<T>where
T: Serialize,
impl<T: Copy> Copy for SinglePrefixMap<T>
impl<T: Eq> Eq for SinglePrefixMap<T>
impl<T> StructuralPartialEq for SinglePrefixMap<T>
Auto Trait Implementations§
impl<T> Freeze for SinglePrefixMap<T>where
T: Freeze,
impl<T> RefUnwindSafe for SinglePrefixMap<T>where
T: RefUnwindSafe,
impl<T> Send for SinglePrefixMap<T>where
T: Send,
impl<T> Sync for SinglePrefixMap<T>where
T: Sync,
impl<T> Unpin for SinglePrefixMap<T>where
T: Unpin,
impl<T> UnwindSafe for SinglePrefixMap<T>where
T: 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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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 moreSource§impl<'n, P, Q, Ospf, I, K, V> NetworkFormatterMap<'n, P, Q, Ospf> for Iwhere
P: Prefix,
Ospf: OspfImpl,
I: IntoIterator<Item = (K, V)>,
K: NetworkFormatter<'n, P, Q, Ospf>,
V: NetworkFormatter<'n, P, Q, Ospf>,
impl<'n, P, Q, Ospf, I, K, V> NetworkFormatterMap<'n, P, Q, Ospf> for Iwhere
P: Prefix,
Ospf: OspfImpl,
I: IntoIterator<Item = (K, V)>,
K: NetworkFormatter<'n, P, Q, Ospf>,
V: NetworkFormatter<'n, P, Q, Ospf>,
Source§impl<'n, P, Q, Ospf, I, T> NetworkFormatterSequence<'n, P, Q, Ospf> for I
impl<'n, P, Q, Ospf, I, T> NetworkFormatterSequence<'n, P, Q, Ospf> for I
Source§fn fmt_set(self, net: &'n Network<P, Q, Ospf>) -> String
fn fmt_set(self, net: &'n Network<P, Q, Ospf>) -> String
Format the iterator as a set, e.g.,
{a, b, c}.Source§fn fmt_set_multiline(
self,
net: &'n Network<P, Q, Ospf>,
indent: usize,
) -> String
fn fmt_set_multiline( self, net: &'n Network<P, Q, Ospf>, indent: usize, ) -> String
Format the iterator as a set over multiple lines.
Source§fn fmt_list(self, net: &'n Network<P, Q, Ospf>) -> String
fn fmt_list(self, net: &'n Network<P, Q, Ospf>) -> String
Format the iterator as a list, e.g.,
[a, b, c].