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 MarkStorage<Mark>
impl MarkStorage<Mark>
Sourcepub const UNMARKED: MarkStorage<Mark>
pub const UNMARKED: MarkStorage<Mark>
Unmarked marks.
Source§impl<T> MarkStorage<T>
impl<T> MarkStorage<T>
Sourcepub fn new<U, IntoIter>(iter: IntoIter) -> MarkStorage<T>
pub fn new<U, IntoIter>(iter: IntoIter) -> MarkStorage<T>
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,
_: &'a MarkStorage<U>,
) -> impl Iterator<Item = (MarkDomain, &'a T, &'a U)> + 'a
pub fn zip_with<'a, U>( &'a self, _: &'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 for MarkStorage<T>where
T: Clone,
impl<T> Clone for MarkStorage<T>where
T: Clone,
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 for MarkStorage<T>where
T: Debug,
impl<T> Debug for MarkStorage<T>where
T: Debug,
Source§impl<T> Default for MarkStorage<T>where
T: Default,
impl<T> Default for MarkStorage<T>where
T: Default,
Source§fn default() -> MarkStorage<T>
fn default() -> MarkStorage<T>
Returns the “default value” for a type. Read more