pub struct Packet {
pub source_device_identifier: u8,
pub id: IdType,
pub data: PacketDataBytes,
/* private fields */
}Fields§
§source_device_identifier: u8§id: IdType§data: PacketDataBytesImplementations§
Source§impl Packet
impl Packet
Sourcepub fn is_checksum_correct(&self) -> bool
pub fn is_checksum_correct(&self) -> bool
Checks if the calculated checksum of the packet matches to the already stored one.
Sourcepub fn summarized(self) -> Packet
pub fn summarized(self) -> Packet
Calculates checksum for this packet, and sets calculated value into .checksum field. returns new summarized packet.
Source§impl Packet
impl Packet
pub fn is_destination_reached(&self, identifier: GeneralAddressType) -> bool
Source§impl Packet
impl Packet
pub fn get_spec_state(&self) -> PacketState
pub fn set_spec_state(&mut self, new_state: PacketState)
Source§impl Packet
impl Packet
pub fn new( source_device_identifier: u8, destination_device_identifier: u8, id: IdType, lifetime: LifeTimeType, spec_state: PacketState, ignore_duplications_flag: bool, data: PacketDataBytes, ) -> Packet
pub fn has_correct_source_device_identifier(&self) -> bool
pub const fn size_of_bytes() -> usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Packet
impl RefUnwindSafe for Packet
impl Send for Packet
impl Sync for Packet
impl Unpin for Packet
impl UnsafeUnpin for Packet
impl UnwindSafe for Packet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more