pub struct OfflineRetentionPolicy {
pub online_ttl: Duration,
pub offline_ttl: Duration,
pub keep_last_n: usize,
}Expand description
Offline retention policy for connectivity-aware lifecycle
When a node is offline, it cannot contribute to the mesh anyway. More aggressive eviction saves storage and battery while preserving the ability to re-sync latest state from peers when reconnected.
Fields§
§online_ttl: DurationTTL when node is online (normal retention)
offline_ttl: DurationTTL when node is offline (aggressive eviction)
Typically 10x shorter than online_ttl to free resources
keep_last_n: usizeAlways keep last N items per collection, even when offline
Implementations§
Source§impl OfflineRetentionPolicy
impl OfflineRetentionPolicy
Sourcepub fn minimal() -> OfflineRetentionPolicy
pub fn minimal() -> OfflineRetentionPolicy
Create a minimal retention policy for storage-constrained devices
Sourcepub fn conservative() -> OfflineRetentionPolicy
pub fn conservative() -> OfflineRetentionPolicy
Create a conservative retention policy
Trait Implementations§
Source§impl Clone for OfflineRetentionPolicy
impl Clone for OfflineRetentionPolicy
Source§fn clone(&self) -> OfflineRetentionPolicy
fn clone(&self) -> OfflineRetentionPolicy
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for OfflineRetentionPolicy
impl RefUnwindSafe for OfflineRetentionPolicy
impl Send for OfflineRetentionPolicy
impl Sync for OfflineRetentionPolicy
impl Unpin for OfflineRetentionPolicy
impl UnsafeUnpin for OfflineRetentionPolicy
impl UnwindSafe for OfflineRetentionPolicy
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more