Struct smoltcp::wire::EthernetFrame [−][src]
A read/write wrapper around an Ethernet II frame buffer.
Implementations
impl<T: AsRef<[u8]>> Frame<T>
[src]
pub fn new_unchecked(buffer: T) -> Frame<T>
[src]
Imbue a raw octet buffer with Ethernet frame structure.
pub fn new_checked(buffer: T) -> Result<Frame<T>>
[src]
Shorthand for a combination of new_unchecked and check_len.
pub 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.
pub fn into_inner(self) -> T
[src]
Consumes the frame, returning the underlying buffer.
pub fn header_len() -> usize
[src]
Return the length of a frame header.
pub 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.
pub fn dst_addr(&self) -> Address
[src]
Return the destination address field.
pub fn src_addr(&self) -> Address
[src]
Return the source address field.
pub 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]
pub fn set_dst_addr(&mut self, value: Address)
[src]
Set the destination address field.
pub fn set_src_addr(&mut self, value: Address)
[src]
Set the source address field.
pub fn set_ethertype(&mut self, value: EtherType)
[src]
Set the EtherType field.
pub fn payload_mut(&mut self) -> &mut [u8]
[src]
Return a mutable pointer to the payload.
Trait Implementations
impl<T: AsRef<[u8]>> AsRef<[u8]> for Frame<T>
[src]
impl<T: Clone + AsRef<[u8]>> Clone for Frame<T>
[src]
impl<T: Debug + AsRef<[u8]>> Debug for Frame<T>
[src]
impl<T: AsRef<[u8]>> Display for Frame<T>
[src]
impl<T: AsRef<[u8]>> PrettyPrint for Frame<T>
[src]
fn pretty_print(
buffer: &dyn AsRef<[u8]>,
f: &mut Formatter<'_>,
indent: &mut PrettyIndent
) -> Result
[src]
buffer: &dyn AsRef<[u8]>,
f: &mut Formatter<'_>,
indent: &mut PrettyIndent
) -> Result
Auto Trait Implementations
impl<T> RefUnwindSafe for Frame<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Frame<T> where
T: Send,
T: Send,
impl<T> Sync for Frame<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Frame<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Frame<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,