Struct etherparse::Ethernet2Header [−][src]
Ethernet II header.
Fields
source: [u8; 6]
destination: [u8; 6]
ether_type: u16
Implementations
impl Ethernet2Header
[src]
pub fn read_from_slice(
slice: &[u8]
) -> Result<(Ethernet2Header, &[u8]), ReadError>
[src]
slice: &[u8]
) -> Result<(Ethernet2Header, &[u8]), ReadError>
Read an Ethernet2Header from a slice and return the header & unused parts of the slice.
pub fn read<T: Read + Seek + Sized>(
reader: &mut T
) -> Result<Ethernet2Header, Error>
[src]
reader: &mut T
) -> Result<Ethernet2Header, Error>
Reads an Ethernet-II header from the current position of the read argument.
pub fn write_to_slice<'a>(
&self,
slice: &'a mut [u8]
) -> Result<&'a mut [u8], WriteError>
[src]
&self,
slice: &'a mut [u8]
) -> Result<&'a mut [u8], WriteError>
Serialize the header to a given slice. Returns the unused part of the slice.
pub fn write<T: Write + Sized>(&self, writer: &mut T) -> Result<(), Error>
[src]
Writes a given Ethernet-II header to the current position of the write argument.
Trait Implementations
impl Clone for Ethernet2Header
[src]
fn clone(&self) -> Ethernet2Header
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Ethernet2Header
[src]
impl Default for Ethernet2Header
[src]
fn default() -> Ethernet2Header
[src]
impl Eq for Ethernet2Header
[src]
impl PartialEq<Ethernet2Header> for Ethernet2Header
[src]
fn eq(&self, other: &Ethernet2Header) -> bool
[src]
fn ne(&self, other: &Ethernet2Header) -> bool
[src]
impl SerializedSize for Ethernet2Header
[src]
const SERIALIZED_SIZE: usize
[src]
Serialized size of the header in bytes.
impl StructuralEq for Ethernet2Header
[src]
impl StructuralPartialEq for Ethernet2Header
[src]
Auto Trait Implementations
impl RefUnwindSafe for Ethernet2Header
[src]
impl Send for Ethernet2Header
[src]
impl Sync for Ethernet2Header
[src]
impl Unpin for Ethernet2Header
[src]
impl UnwindSafe for Ethernet2Header
[src]
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, 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>,