pub struct DhcpOption {
pub code: u8,
pub data: Vec<u8>,
}Expand description
A parsed DHCP option.
Fields§
§code: u8§data: Vec<u8>Implementations§
Source§impl DhcpOption
impl DhcpOption
pub fn new(code: u8, data: Vec<u8>) -> Self
Sourcepub fn message_type(msg_type: u8) -> Self
pub fn message_type(msg_type: u8) -> Self
Create a message type option.
Sourcepub fn lease_time(seconds: u32) -> Self
pub fn lease_time(seconds: u32) -> Self
Create a lease time option.
Sourcepub fn subnet_mask(mask: Ipv4Addr) -> Self
pub fn subnet_mask(mask: Ipv4Addr) -> Self
Create a subnet mask option.
Sourcepub fn domain_name(name: &str) -> Self
pub fn domain_name(name: &str) -> Self
Create a domain name option.
Sourcepub fn as_message_type(&self) -> Option<u8>
pub fn as_message_type(&self) -> Option<u8>
Get the message type value (if this is a message type option).
Trait Implementations§
Source§impl Clone for DhcpOption
impl Clone for DhcpOption
Source§fn clone(&self) -> DhcpOption
fn clone(&self) -> DhcpOption
Returns a duplicate of the value. Read more
1.0.0 · 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 DhcpOption
impl Debug for DhcpOption
Source§impl PartialEq for DhcpOption
impl PartialEq for DhcpOption
impl Eq for DhcpOption
impl StructuralPartialEq for DhcpOption
Auto Trait Implementations§
impl Freeze for DhcpOption
impl RefUnwindSafe for DhcpOption
impl Send for DhcpOption
impl Sync for DhcpOption
impl Unpin for DhcpOption
impl UnsafeUnpin for DhcpOption
impl UnwindSafe for DhcpOption
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more