#[repr(C, packed(1))]pub struct eth_hdr {
pub dst: eth_addr,
pub src: eth_addr,
pub proto: u16,
}Fields§
§dst: eth_addr§src: eth_addr§proto: u16Implementations§
Source§impl eth_hdr
impl eth_hdr
pub fn new(src: eth_addr, dst: eth_addr, proto: u16) -> Self
pub fn with_proto(proto: u16) -> Self
pub fn dst_from_ip(&mut self, addr: Ipv4Addr) -> &mut Self
pub fn src_from_ip(&mut self, addr: Ipv4Addr) -> &mut Self
pub fn set_proto(&mut self, proto: u16) -> &mut Self
pub fn set_broadcast(&mut self) -> &mut Self
Trait Implementations§
impl Copy for eth_hdr
impl Pod for eth_hdr
Auto Trait Implementations§
impl Freeze for eth_hdr
impl RefUnwindSafe for eth_hdr
impl Send for eth_hdr
impl Sync for eth_hdr
impl Unpin for eth_hdr
impl UnsafeUnpin for eth_hdr
impl UnwindSafe for eth_hdr
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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.