pub struct Hops(/* private fields */);Expand description
Bounded, loop-free list of Hop entries: the hop chain of a broadcast.
Guarantees len() <= MAX_HOPS and that no non-zero Hop appears twice. Both
are wire rules, and both hold wherever a list exists rather than only where one was
parsed, so a chain that a conforming receiver would reject cannot be built and sent.
Construct via Hops::new + Hops::push, or fall back to the
fallible TryFrom<Vec<Hop>>.
Implementations§
Source§impl Hops
impl Hops
Sourcepub fn push(&mut self, hop: Hop) -> Result<(), InvalidHop>
pub fn push(&mut self, hop: Hop) -> Result<(), InvalidHop>
Append an Hop, rejecting anything a conforming receiver would.
Fails with InvalidHop::TooMany once the list is full, and with
InvalidHop::Duplicate for an id already in the chain, which is a loop. The
reserved id 0 identifies nothing, so it may repeat.
Trait Implementations§
impl Eq for Hops
Source§impl<'a> IntoIterator for &'a Hops
impl<'a> IntoIterator for &'a Hops
impl StructuralPartialEq for Hops
Auto Trait Implementations§
impl Freeze for Hops
impl RefUnwindSafe for Hops
impl Send for Hops
impl Sync for Hops
impl Unpin for Hops
impl UnsafeUnpin for Hops
impl UnwindSafe for Hops
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