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
sourceimpl 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
sourceimpl Block for PrimaryBlock
impl Block for PrimaryBlock
sourcefn to_cbor(&self) -> ByteBuffer
fn to_cbor(&self) -> ByteBuffer
Convert block struct to a serializable enum
sourceimpl Clone for PrimaryBlock
impl Clone for PrimaryBlock
sourcefn clone(&self) -> PrimaryBlock
fn clone(&self) -> PrimaryBlock
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl CrcBlock for PrimaryBlock
impl CrcBlock for PrimaryBlock
fn crc_value(&self) -> &CrcValue
fn set_crc(&mut self, crc: CrcValue)
sourcefn update_crc(&mut self)
fn update_crc(&mut self)
Recalculate crc value
sourcefn 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 Read more
sourcefn crc_type(&self) -> CrcRawType
fn crc_type(&self) -> CrcRawType
Return the crc type code
sourceimpl Debug for PrimaryBlock
impl Debug for PrimaryBlock
sourceimpl Default for PrimaryBlock
impl Default for PrimaryBlock
sourceimpl<'de> Deserialize<'de> for PrimaryBlock
impl<'de> Deserialize<'de> for PrimaryBlock
sourcefn 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
sourceimpl PartialEq<PrimaryBlock> for PrimaryBlock
impl PartialEq<PrimaryBlock> for PrimaryBlock
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &PrimaryBlock) -> bool
fn ne(&self, other: &PrimaryBlock) -> bool
This method tests for !=
.
sourceimpl 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more