Struct netsim_embed::vlan::MutableVlanPacket  
source · pub struct MutableVlanPacket<'p> { /* private fields */ }Expand description
A structure enabling manipulation of on the wire packets
Implementations§
source§impl<'a> MutableVlanPacket<'a>
 
impl<'a> MutableVlanPacket<'a>
sourcepub fn new<'p>(packet: &'p mut [u8]) -> Option<MutableVlanPacket<'p>>
 
pub fn new<'p>(packet: &'p mut [u8]) -> Option<MutableVlanPacket<'p>>
Constructs a new #name. If the provided buffer is less than the minimum required packet size, this will return None.
sourcepub fn owned(packet: Vec<u8, Global>) -> Option<MutableVlanPacket<'static>>
 
pub fn owned(packet: Vec<u8, Global>) -> Option<MutableVlanPacket<'static>>
Constructs a new #name. If the provided buffer is less than the minimum required packet size, this will return None. With this constructor the #name will own its own data and the underlying buffer will be dropped when the #name is.
sourcepub fn to_immutable<'p>(&'p self) -> VlanPacket<'p>
 
pub fn to_immutable<'p>(&'p self) -> VlanPacket<'p>
Maps from a #name to a #imm_name
sourcepub fn consume_to_immutable(self) -> VlanPacket<'a>
 
pub fn consume_to_immutable(self) -> VlanPacket<'a>
Maps from a #name to a #imm_name while consuming the source
sourcepub const fn minimum_packet_size() -> usize
 
pub const fn minimum_packet_size() -> usize
The minimum size (in bytes) a packet of this type can be. It’s based on the total size of the fixed-size fields.
sourcepub fn packet_size(_packet: &Vlan) -> usize
 
pub fn packet_size(_packet: &Vlan) -> usize
The size (in bytes) of a #base_name instance when converted into a byte-array
sourcepub fn get_priority_code_point(&self) -> ClassOfService
 
pub fn get_priority_code_point(&self) -> ClassOfService
Get the value of the {name} field
sourcepub fn get_drop_eligible_indicator(&self) -> u8
 
pub fn get_drop_eligible_indicator(&self) -> u8
Get the drop_eligible_indicator field. This field is always stored big-endian within the struct, but this accessor returns host order.
sourcepub fn get_vlan_identifier(&self) -> u16
 
pub fn get_vlan_identifier(&self) -> u16
Get the vlan_identifier field. This field is always stored big-endian within the struct, but this accessor returns host order.
sourcepub fn get_ethertype(&self) -> EtherType
 
pub fn get_ethertype(&self) -> EtherType
Get the value of the {name} field
sourcepub fn get_payload(&self) -> Vec<u8, Global>
 
pub fn get_payload(&self) -> Vec<u8, Global>
Get the value of the {name} field (copies contents)
sourcepub fn set_priority_code_point(&mut self, val: ClassOfService)
 
pub fn set_priority_code_point(&mut self, val: ClassOfService)
Set the value of the {name} field.
sourcepub fn set_drop_eligible_indicator(&mut self, val: u8)
 
pub fn set_drop_eligible_indicator(&mut self, val: u8)
Set the drop_eligible_indicator field. This field is always stored big-endian within the struct, but this mutator wants host order.
sourcepub fn set_vlan_identifier(&mut self, val: u16)
 
pub fn set_vlan_identifier(&mut self, val: u16)
Set the vlan_identifier field. This field is always stored big-endian within the struct, but this mutator wants host order.
sourcepub fn set_ethertype(&mut self, val: EtherType)
 
pub fn set_ethertype(&mut self, val: EtherType)
Set the value of the {name} field.
sourcepub fn set_payload(&mut self, vals: &[u8])
 
pub fn set_payload(&mut self, vals: &[u8])
Set the value of the {name} field (copies contents)