Struct dtn7::core::bundlepack::BundlePack
source · pub struct BundlePack {
pub source: EndpointID,
pub destination: EndpointID,
pub received_time: u64,
pub creation_time: u64,
pub lifetime: u64,
pub id: String,
pub administrative: bool,
pub size: usize,
pub constraints: HashSet<Constraint>,
}
Expand description
BundlePack is a set of a bundle, it’s creation or reception time stamp and a set of constraints used in the process of delivering this bundle.
Fields§
§source: EndpointID
§destination: EndpointID
§received_time: u64
time at which bundle was received at this node in unix time as milliseconds
creation_time: u64
time at which bundle was created in dtntime
lifetime: u64
§id: String
§administrative: bool
§size: usize
§constraints: HashSet<Constraint>
Implementations§
source§impl BundlePack
impl BundlePack
pub fn id(&self) -> &str
pub fn sync(&self) -> Result<()>
sourcepub fn has_expired(&self) -> bool
pub fn has_expired(&self) -> bool
check if lifetime is expired if lifetime is set to zero, ignore this check
pub fn has_receiver(&self) -> bool
pub fn has_constraint(&self, constraint: Constraint) -> bool
pub fn has_constraints(&self) -> bool
pub fn add_constraint(&mut self, constraint: Constraint)
pub fn remove_constraint(&mut self, constraint: Constraint)
pub fn clear_constraints(&mut self)
pub fn set_constraints(&mut self, constraints: HashSet<Constraint>)
pub fn to_cbor(&self) -> ByteBuffer
Trait Implementations§
source§impl Clone for BundlePack
impl Clone for BundlePack
source§fn clone(&self) -> BundlePack
fn clone(&self) -> BundlePack
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 Debug for BundlePack
impl Debug for BundlePack
source§impl<'de> Deserialize<'de> for BundlePack
impl<'de> Deserialize<'de> for BundlePack
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 Display for BundlePack
impl Display for BundlePack
source§impl From<&[u8]> for BundlePack
impl From<&[u8]> for BundlePack
Create from a given bundle.
source§impl From<&Bundle> for BundlePack
impl From<&Bundle> for BundlePack
Create from a given bundle.
source§impl From<Bundle> for BundlePack
impl From<Bundle> for BundlePack
Create from a given bundle.
source§impl PartialEq for BundlePack
impl PartialEq for BundlePack
source§fn eq(&self, other: &BundlePack) -> bool
fn eq(&self, other: &BundlePack) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for BundlePack
impl Serialize for BundlePack
impl Eq for BundlePack
impl StructuralPartialEq for BundlePack
Auto Trait Implementations§
impl Freeze for BundlePack
impl RefUnwindSafe for BundlePack
impl Send for BundlePack
impl Sync for BundlePack
impl Unpin for BundlePack
impl UnwindSafe for BundlePack
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
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.