pub struct Ipv4Repr {
pub src_addr: Address,
pub dst_addr: Address,
pub protocol: Protocol,
pub payload_len: usize,
pub hop_limit: u8,
}Expand description
A high-level representation of an Internet Protocol version 4 packet header.
Fields
src_addr: Addressdst_addr: Addressprotocol: Protocolpayload_len: usizehop_limit: u8Implementations
sourceimpl Repr
impl Repr
sourcepub fn parse<T: AsRef<[u8]> + ?Sized>(
packet: &Packet<&T>,
checksum_caps: &ChecksumCapabilities
) -> Result<Repr>
pub fn parse<T: AsRef<[u8]> + ?Sized>(
packet: &Packet<&T>,
checksum_caps: &ChecksumCapabilities
) -> Result<Repr>
Parse an Internet Protocol version 4 packet and return a high-level representation.
sourcepub fn buffer_len(&self) -> usize
pub fn buffer_len(&self) -> usize
Return the length of a header that will be emitted from this high-level representation.
sourcepub fn emit<T: AsRef<[u8]> + AsMut<[u8]>>(
&self,
packet: &mut Packet<T>,
checksum_caps: &ChecksumCapabilities
)
pub fn emit<T: AsRef<[u8]> + AsMut<[u8]>>(
&self,
packet: &mut Packet<T>,
checksum_caps: &ChecksumCapabilities
)
Emit a high-level representation into an Internet Protocol version 4 packet.
Trait Implementations
impl Copy for Repr
impl Eq for Repr
impl StructuralEq for Repr
impl StructuralPartialEq for Repr
Auto Trait Implementations
impl RefUnwindSafe for Repr
impl Send for Repr
impl Sync for Repr
impl Unpin for Repr
impl UnwindSafe for Repr
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstablefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
fn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more