Struct bp7::primary::PrimaryBlock
source · pub struct PrimaryBlock {
pub bundle_control_flags: BundleControlFlagsType,
pub crc: CrcValue,
pub destination: EndpointID,
pub source: EndpointID,
pub report_to: EndpointID,
pub creation_timestamp: CreationTimestamp,
pub lifetime: Duration,
pub fragmentation_offset: FragOffsetType,
pub total_data_length: TotalDataLengthType,
/* private fields */
}
Fields§
§bundle_control_flags: BundleControlFlagsType
§crc: CrcValue
§destination: EndpointID
§source: EndpointID
§report_to: EndpointID
§creation_timestamp: CreationTimestamp
§lifetime: Duration
in milliseconds
fragmentation_offset: FragOffsetType
§total_data_length: TotalDataLengthType
Implementations§
source§impl PrimaryBlock
impl PrimaryBlock
pub fn new() -> PrimaryBlock
pub fn has_fragmentation(&self) -> bool
pub fn is_lifetime_exceeded(&self) -> bool
pub fn validate(&self) -> Result<(), ErrorList>
Trait Implementations§
source§impl Block for PrimaryBlock
impl Block for PrimaryBlock
source§fn to_cbor(&self) -> ByteBuffer
fn to_cbor(&self) -> ByteBuffer
Convert block struct to a serializable enum
source§impl Clone for PrimaryBlock
impl Clone for PrimaryBlock
source§fn clone(&self) -> PrimaryBlock
fn clone(&self) -> PrimaryBlock
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl CrcBlock for PrimaryBlock
impl CrcBlock for PrimaryBlock
fn crc_value(&self) -> &CrcValue
fn set_crc(&mut self, crc: CrcValue)
source§fn update_crc(&mut self)
fn update_crc(&mut self)
Recalculate crc value
source§fn set_crc_type(&mut self, crc_value: CrcRawType)
fn set_crc_type(&mut self, crc_value: CrcRawType)
Set crc type
CRC_NO, CRC_16, CRC_32
source§fn crc_type(&self) -> CrcRawType
fn crc_type(&self) -> CrcRawType
Return the crc type code
source§impl Debug for PrimaryBlock
impl Debug for PrimaryBlock
source§impl Default for PrimaryBlock
impl Default for PrimaryBlock
source§impl<'de> Deserialize<'de> for PrimaryBlock
impl<'de> Deserialize<'de> for PrimaryBlock
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for PrimaryBlock
impl PartialEq for PrimaryBlock
source§fn eq(&self, other: &PrimaryBlock) -> bool
fn eq(&self, other: &PrimaryBlock) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for PrimaryBlock
impl Serialize for PrimaryBlock
impl StructuralPartialEq for PrimaryBlock
Auto Trait Implementations§
impl RefUnwindSafe for PrimaryBlock
impl Send for PrimaryBlock
impl Sync for PrimaryBlock
impl Unpin for PrimaryBlock
impl UnwindSafe for PrimaryBlock
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