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: boolUsed to work around some clients that cannot accept IP unicast datagrams before the TCP/IP software is configured.
Implementations§
Source§impl Flags
impl Flags
Sourcepub const fn temporary_to_bytes(&self) -> [u8; 2]
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§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more