pub struct MutableOneRttPacket<'p> { /* private fields */ }
Expand description
A structure enabling manipulation of on the wire packets
Implementations§
Source§impl<'a> MutableOneRttPacket<'a>
impl<'a> MutableOneRttPacket<'a>
Sourcepub fn new<'p>(packet: &'p mut [u8]) -> Option<MutableOneRttPacket<'p>>
pub fn new<'p>(packet: &'p mut [u8]) -> Option<MutableOneRttPacket<'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>) -> Option<MutableOneRttPacket<'static>>
pub fn owned(packet: Vec<u8>) -> Option<MutableOneRttPacket<'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) -> OneRttPacket<'p>
pub fn to_immutable<'p>(&'p self) -> OneRttPacket<'p>
Maps from a #name to a #imm_name
Sourcepub fn consume_to_immutable(self) -> OneRttPacket<'a>
pub fn consume_to_immutable(self) -> OneRttPacket<'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: &OneRtt) -> usize
pub fn packet_size(_packet: &OneRtt) -> usize
The size (in bytes) of a #base_name instance when converted into a byte-array
Sourcepub fn get_header_form(&self) -> u1
pub fn get_header_form(&self) -> u1
Get the header_form field. This field is always stored big-endian within the struct, but this accessor returns host order.
Sourcepub fn get_fixed_bit(&self) -> u1
pub fn get_fixed_bit(&self) -> u1
Get the fixed_bit field. This field is always stored big-endian within the struct, but this accessor returns host order.
Sourcepub fn get_spin_bit(&self) -> u1
pub fn get_spin_bit(&self) -> u1
Get the spin_bit field. This field is always stored big-endian within the struct, but this accessor returns host order.
Sourcepub fn get_reserved_bits(&self) -> u2
pub fn get_reserved_bits(&self) -> u2
Get the reserved_bits field. This field is always stored big-endian within the struct, but this accessor returns host order.
Sourcepub fn get_key_phase(&self) -> u1
pub fn get_key_phase(&self) -> u1
Get the key_phase field. This field is always stored big-endian within the struct, but this accessor returns host order.
Sourcepub fn get_packet_number_len(&self) -> u2
pub fn get_packet_number_len(&self) -> u2
Get the packet_number_len field. This field is always stored big-endian within the struct, but this accessor returns host order.
Sourcepub fn get_dest_id_raw(&self) -> &[u8] ⓘ
pub fn get_dest_id_raw(&self) -> &[u8] ⓘ
Get the raw &u8 value of the {name} field, without copying
Sourcepub fn get_dest_id(&self) -> Vec<u8> ⓘ
pub fn get_dest_id(&self) -> Vec<u8> ⓘ
Get the value of the {name} field (copies contents)
Sourcepub fn get_packet_number_raw(&self) -> &[u8] ⓘ
pub fn get_packet_number_raw(&self) -> &[u8] ⓘ
Get the raw &u8 value of the {name} field, without copying
Sourcepub fn get_packet_number(&self) -> Vec<u8> ⓘ
pub fn get_packet_number(&self) -> Vec<u8> ⓘ
Get the value of the {name} field (copies contents)
Sourcepub fn get_payload(&self) -> Vec<u8> ⓘ
pub fn get_payload(&self) -> Vec<u8> ⓘ
Get the value of the {name} field (copies contents)
Sourcepub fn set_header_form(&mut self, val: u1)
pub fn set_header_form(&mut self, val: u1)
Set the header_form field. This field is always stored big-endian within the struct, but this mutator wants host order.
Sourcepub fn set_fixed_bit(&mut self, val: u1)
pub fn set_fixed_bit(&mut self, val: u1)
Set the fixed_bit field. This field is always stored big-endian within the struct, but this mutator wants host order.
Sourcepub fn set_spin_bit(&mut self, val: u1)
pub fn set_spin_bit(&mut self, val: u1)
Set the spin_bit field. This field is always stored big-endian within the struct, but this mutator wants host order.
Sourcepub fn set_reserved_bits(&mut self, val: u2)
pub fn set_reserved_bits(&mut self, val: u2)
Set the reserved_bits field. This field is always stored big-endian within the struct, but this mutator wants host order.
Sourcepub fn set_key_phase(&mut self, val: u1)
pub fn set_key_phase(&mut self, val: u1)
Set the key_phase field. This field is always stored big-endian within the struct, but this mutator wants host order.
Sourcepub fn set_packet_number_len(&mut self, val: u2)
pub fn set_packet_number_len(&mut self, val: u2)
Set the packet_number_len field. This field is always stored big-endian within the struct, but this mutator wants host order.
Sourcepub fn get_dest_id_raw_mut(&mut self) -> &mut [u8] ⓘ
pub fn get_dest_id_raw_mut(&mut self) -> &mut [u8] ⓘ
Get the raw &mut u8 value of the {name} field, without copying
Sourcepub fn set_dest_id(&mut self, vals: &[u8])
pub fn set_dest_id(&mut self, vals: &[u8])
Set the value of the {name} field (copies contents)
Sourcepub fn get_packet_number_raw_mut(&mut self) -> &mut [u8] ⓘ
pub fn get_packet_number_raw_mut(&mut self) -> &mut [u8] ⓘ
Get the raw &mut u8 value of the {name} field, without copying
Sourcepub fn set_packet_number(&mut self, vals: &[u8])
pub fn set_packet_number(&mut self, vals: &[u8])
Set the value of the {name} field (copies contents)
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)