Flags

Struct Flags 

Source
pub struct Flags {
    pub broadcast: bool,
}
Expand description

Wraps a bit field used in Message.

The two bytes that this field occupies were unused in RFC-951, and later defined then clarified in RFC-1542.

The leftmost bit is defined as the Broadcast flag. The remaining bits are reserved for future use, and must be set to zero by clients and ignored by servers and relay agents.

Fields§

§broadcast: bool

Used to work around some clients that cannot accept IP unicast datagrams before the TCP/IP software is configured.

Implementations§

Source§

impl Flags

Source

pub const fn temporary_to_bytes(&self) -> [u8; 2]

As long as the flags field is only used for broadcasts then this method can be used as a faster way to serialize the broadcast value to bytes.

Otherwise, you’ll want to use the existing From impl.

As of 2025 I do not see any RFC that updates RFC-2131 with new flags.

Trait Implementations§

Source§

impl Debug for Flags

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<&Flags> for [u8; 2]

Source§

fn from(flags: &Flags) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Flags

Source§

fn eq(&self, other: &Flags) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Flags

Auto Trait Implementations§

§

impl Freeze for Flags

§

impl RefUnwindSafe for Flags

§

impl Send for Flags

§

impl Sync for Flags

§

impl Unpin for Flags

§

impl UnwindSafe for Flags

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V