pub struct BundleDescriptor {
pub bundle: Bundle,
pub already_sent: HashSet<EndpointId>,
pub forwarding_attempts: u32,
pub created_at: u64,
}Expand description
BundleDescriptor manages the forwarding state of a bundle It tracks which endpoints have already received this bundle to prevent duplicates
Fields§
§bundle: Bundle§already_sent: HashSet<EndpointId>§forwarding_attempts: u32§created_at: u64Implementations§
Source§impl BundleDescriptor
impl BundleDescriptor
pub fn new(bundle: Bundle) -> Self
pub fn mark_sent(&mut self, eid: EndpointId)
pub fn get_already_sent(&self) -> &HashSet<EndpointId>
Sourcepub fn has_been_sent_to(&self, eid: &EndpointId) -> bool
pub fn has_been_sent_to(&self, eid: &EndpointId) -> bool
Check if this bundle has been sent to a specific endpoint
Sourcepub fn increment_forwarding_attempts(&mut self)
pub fn increment_forwarding_attempts(&mut self)
Increment the forwarding attempt counter
Sourcepub fn get_forwarding_attempts(&self) -> u32
pub fn get_forwarding_attempts(&self) -> u32
Get the number of forwarding attempts
Sourcepub fn is_ready_for_forwarding(&self, max_attempts: u32) -> bool
pub fn is_ready_for_forwarding(&self, max_attempts: u32) -> bool
Check if this bundle is ready for forwarding (not expired and not over limit)
Sourcepub fn get_bundle_id(&self) -> String
pub fn get_bundle_id(&self) -> String
Get a unique identifier for this bundle
Trait Implementations§
Source§impl Clone for BundleDescriptor
impl Clone for BundleDescriptor
Source§fn clone(&self) -> BundleDescriptor
fn clone(&self) -> BundleDescriptor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BundleDescriptor
impl RefUnwindSafe for BundleDescriptor
impl Send for BundleDescriptor
impl Sync for BundleDescriptor
impl Unpin for BundleDescriptor
impl UnsafeUnpin for BundleDescriptor
impl UnwindSafe for BundleDescriptor
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