Struct smoltcp::wire::EthernetFrame
[−]
[src]
pub struct EthernetFrame<T: AsRef<[u8]>> { /* fields omitted */ }
A read/write wrapper around an Ethernet II frame buffer.
Methods
impl<T: AsRef<[u8]>> Frame<T>
[src]
fn new(buffer: T) -> Frame<T>
[src]
Imbue a raw octet buffer with Ethernet frame structure.
fn new_checked(buffer: T) -> Result<Frame<T>>
[src]
fn check_len(&self) -> Result<()>
[src]
Ensure that no accessor method will panic if called.
Returns Err(Error::Truncated)
if the buffer is too short.
fn into_inner(self) -> T
[src]
Consumes the frame, returning the underlying buffer.
fn header_len() -> usize
[src]
Return the length of a frame header.
fn buffer_len(payload_len: usize) -> usize
[src]
Return the length of a buffer required to hold a packet with the payload of a given length.
fn dst_addr(&self) -> Address
[src]
Return the destination address field.
fn src_addr(&self) -> Address
[src]
Return the source address field.
fn ethertype(&self) -> EtherType
[src]
Return the EtherType field, without checking for 802.1Q.
impl<'a, T: AsRef<[u8]> + ?Sized> Frame<&'a T>
[src]
impl<T: AsRef<[u8]> + AsMut<[u8]>> Frame<T>
[src]
fn set_dst_addr(&mut self, value: Address)
[src]
Set the destination address field.
fn set_src_addr(&mut self, value: Address)
[src]
Set the source address field.
fn set_ethertype(&mut self, value: EtherType)
[src]
Set the EtherType field.
impl<'a, T: AsRef<[u8]> + AsMut<[u8]> + ?Sized> Frame<&'a mut T>
[src]
fn payload_mut(&mut self) -> &mut [u8]
[src]
Return a mutable pointer to the payload.
Trait Implementations
impl<T: Debug + AsRef<[u8]>> Debug for Frame<T>
[src]
impl<T: AsRef<[u8]>> Display for Frame<T>
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<T: AsRef<[u8]>> PrettyPrint for Frame<T>
[src]
fn pretty_print(
buffer: &AsRef<[u8]>,
f: &mut Formatter,
indent: &mut PrettyIndent
) -> Result
[src]
buffer: &AsRef<[u8]>,
f: &mut Formatter,
indent: &mut PrettyIndent
) -> Result
Write a concise, formatted representation of a packet contained in the provided buffer, and any nested packets it may contain. Read more