pub type Marks = MarkStorage<Mark>;
Expand description
The 2 marks that can be attached to packets.
Aliased Type§
struct Marks(/* private fields */);
Implementations§
Source§impl<T> MarkStorage<T>
impl<T> MarkStorage<T>
Sourcepub fn new<U, IntoIter>(iter: IntoIter) -> Self
pub fn new<U, IntoIter>(iter: IntoIter) -> Self
Creates MarkStorage
s from an iterator of (MarkDomain, U)
.
An unspecified domain will remain default. For the same domain, a later value in the iterator will override an earlier value.
For a specified domain, (Some(value)).into()
will be written.
Sourcepub fn get(&self, domain: MarkDomain) -> &T
pub fn get(&self, domain: MarkDomain) -> &T
Gets an immutable reference to the mark at the given domain.
Sourcepub fn get_mut(&mut self, domain: MarkDomain) -> &mut T
pub fn get_mut(&mut self, domain: MarkDomain) -> &mut T
Gets a mutable reference to the mark at the given domain.
Sourcepub fn iter(&self) -> impl Iterator<Item = (MarkDomain, &T)>
pub fn iter(&self) -> impl Iterator<Item = (MarkDomain, &T)>
Returns an iterator over the mark domains.
Sourcepub fn zip_with<'a, U>(
&'a self,
MarkStorage: &'a MarkStorage<U>,
) -> impl Iterator<Item = (MarkDomain, &'a T, &'a U)> + 'a
pub fn zip_with<'a, U>( &'a self, MarkStorage: &'a MarkStorage<U>, ) -> impl Iterator<Item = (MarkDomain, &'a T, &'a U)> + 'a
Zips with another storage so that the domains align.
Trait Implementations
Source§impl<T: Clone> Clone for MarkStorage<T>
impl<T: Clone> Clone for MarkStorage<T>
Source§fn clone(&self) -> MarkStorage<T>
fn clone(&self) -> MarkStorage<T>
Returns a copy 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 MarkStorage<T>
impl<T: Debug> Debug for MarkStorage<T>
Source§impl<T: Default> Default for MarkStorage<T>
impl<T: Default> Default for MarkStorage<T>
Source§fn default() -> MarkStorage<T>
fn default() -> MarkStorage<T>
Returns the “default value” for a type. Read more