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§
Source§impl From<u8> for Flags
Converts the only byte currently used by the flags field.
For use with UndecodedMessage’s slice_flags_temporary.
impl From<u8> for Flags
Converts the only byte currently used by the flags field.
For use with UndecodedMessage’s slice_flags_temporary.
Warning: If more bit flags are added via RFC then this may need to change or be removed.