Struct netsim::wire::EtherFrame
[−]
[src]
pub struct EtherFrame { /* fields omitted */ }
Represents an ethernet frame.
Methods
impl EtherFrame
[src]
fn new_from_fields(fields: EtherFields, payload: EtherPayload) -> EtherFrame
[src]
Construct a new EthernetFrame
. Using new_from_fields_recursive
can avoid an extra
allocation if you are also constructing the frame's payload.
fn new_from_fields_recursive(
fields: EtherFields,
payload_fields: EtherPayloadFields
) -> EtherFrame
[src]
fields: EtherFields,
payload_fields: EtherPayloadFields
) -> EtherFrame
Construct a new EthernetFrame
.
fn write_to_buffer(
buffer: &mut [u8],
fields: EtherFields,
payload_fields: EtherPayloadFields
)
[src]
buffer: &mut [u8],
fields: EtherFields,
payload_fields: EtherPayloadFields
)
Create a new ethernet frame, writing it to the given buffer.
fn fields(&self) -> EtherFields
[src]
Get the fields of this ethernet frame.
fn set_fields(&mut self, fields: EtherFields)
[src]
Set the fields of this ethernet frame.
fn from_bytes(buffer: Bytes) -> EtherFrame
[src]
Construct a new ethernet frame from the given buffer.
fn source_mac(&self) -> MacAddr
[src]
Get the frame's sender MAC address.
fn dest_mac(&self) -> MacAddr
[src]
Get the frame's destination MAC address.
fn payload(&self) -> EtherPayload
[src]
Get the frame's payload
fn as_bytes(&self) -> &Bytes
[src]
Returns the underlying buffer.
Trait Implementations
impl Clone for EtherFrame
[src]
fn clone(&self) -> EtherFrame
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for EtherFrame
[src]
fn eq(&self, __arg_0: &EtherFrame) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &EtherFrame) -> bool
[src]
This method tests for !=
.