Struct bp7::canonical::CanonicalBlock
source · [−]pub struct CanonicalBlock {
pub block_type: CanonicalBlockType,
pub block_number: u64,
pub block_control_flags: BlockControlFlagsType,
pub crc: CrcValue,
/* private fields */
}
Fields
block_type: CanonicalBlockType
block_number: u64
block_control_flags: BlockControlFlagsType
crc: CrcValue
Implementations
sourceimpl CanonicalBlock
impl CanonicalBlock
pub fn new() -> CanonicalBlock
pub fn validate(&self) -> Result<(), ErrorList>
pub fn extension_validation(&self) -> Result<(), Error>
pub fn data(&self) -> &CanonicalData
pub fn set_data(&mut self, data: CanonicalData)
pub fn payload_data(&self) -> Option<&ByteBuffer>
pub fn hop_count_get(&self) -> Option<(u8, u8)>
pub fn hop_count_increase(&mut self) -> bool
pub fn hop_count_exceeded(&self) -> bool
pub fn bundle_age_update(&mut self, age: u128) -> bool
pub fn bundle_age_get(&self) -> Option<u128>
pub fn previous_node_update(&mut self, nodeid: EndpointID) -> bool
pub fn previous_node_get(&self) -> Option<&EndpointID>
Trait Implementations
sourceimpl Block for CanonicalBlock
impl Block for CanonicalBlock
sourcefn to_cbor(&self) -> ByteBuffer
fn to_cbor(&self) -> ByteBuffer
Convert block struct to a serializable enum
sourceimpl Clone for CanonicalBlock
impl Clone for CanonicalBlock
sourcefn clone(&self) -> CanonicalBlock
fn clone(&self) -> CanonicalBlock
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 CanonicalBlock
impl CrcBlock for CanonicalBlock
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 CanonicalBlock
impl Debug for CanonicalBlock
sourceimpl Default for CanonicalBlock
impl Default for CanonicalBlock
sourceimpl<'de> Deserialize<'de> for CanonicalBlock
impl<'de> Deserialize<'de> for CanonicalBlock
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<CanonicalBlock> for CanonicalBlock
impl PartialEq<CanonicalBlock> for CanonicalBlock
sourcefn eq(&self, other: &CanonicalBlock) -> bool
fn eq(&self, other: &CanonicalBlock) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &CanonicalBlock) -> bool
fn ne(&self, other: &CanonicalBlock) -> bool
This method tests for !=
.
sourceimpl Serialize for CanonicalBlock
impl Serialize for CanonicalBlock
impl StructuralPartialEq for CanonicalBlock
Auto Trait Implementations
impl RefUnwindSafe for CanonicalBlock
impl Send for CanonicalBlock
impl Sync for CanonicalBlock
impl Unpin for CanonicalBlock
impl UnwindSafe for CanonicalBlock
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