pub struct RouteFlags(/* private fields */);Expand description
Route flags (bitflags — multiple flags can be set simultaneously)
Implementations§
Source§impl RouteFlags
impl RouteFlags
Sourcepub const REQUIRES_ACK: Self
pub const REQUIRES_ACK: Self
Requires acknowledgment
Sourcepub const END_OF_STREAM: Self
pub const END_OF_STREAM: Self
Last packet in stream
Sourcepub fn from_u8(v: u8) -> Self
pub fn from_u8(v: u8) -> Self
Parse flags from u8.
The & 0x0F mask drops the high nibble. Today the defined
flags fit in the low nibble (CONTROL, REQUIRES_ACK,
PRIORITY, END_OF_STREAM), so 16 distinct wire bytes
alias to the same RouteFlags. The high nibble is
reserved: any future flag added there will be silently
stripped by old peers running this codepath. When a new flag
is introduced:
- Allocate it in the low nibble if any bit is still free, OR
- Widen this mask in the same release that defines the new flag, in lock-step across every peer that decodes routing headers (Rust + cross-language bindings). A skew where one peer reads the bit and another masks it off silently diverges on routing semantics.
Sourcepub fn is_control(self) -> bool
pub fn is_control(self) -> bool
Check if this is a control packet
Sourcepub fn is_priority(self) -> bool
pub fn is_priority(self) -> bool
Check if this is a priority packet
Trait Implementations§
Source§impl Clone for RouteFlags
impl Clone for RouteFlags
Source§fn clone(&self) -> RouteFlags
fn clone(&self) -> RouteFlags
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RouteFlags
impl Debug for RouteFlags
Source§impl Default for RouteFlags
impl Default for RouteFlags
Source§fn default() -> RouteFlags
fn default() -> RouteFlags
Returns the “default value” for a type. Read more
Source§impl PartialEq for RouteFlags
impl PartialEq for RouteFlags
Source§fn eq(&self, other: &RouteFlags) -> bool
fn eq(&self, other: &RouteFlags) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for RouteFlags
impl Eq for RouteFlags
impl StructuralPartialEq for RouteFlags
Auto Trait Implementations§
impl Freeze for RouteFlags
impl RefUnwindSafe for RouteFlags
impl Send for RouteFlags
impl Sync for RouteFlags
impl Unpin for RouteFlags
impl UnsafeUnpin for RouteFlags
impl UnwindSafe for RouteFlags
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.