pub struct PendingSync {
pub data: Vec<u8>,
pub qos_class: QoSClass,
pub data_type: DataType,
pub queued_at: Instant,
pub priority_multiplier: f32,
}Expand description
A pending synchronization item
Fields§
§data: Vec<u8>The data to synchronize
qos_class: QoSClassQoS class for this data
data_type: DataTypeType of data being synced
queued_at: InstantWhen this item was enqueued
priority_multiplier: f32Priority multiplier for aging (1.0 = normal)
Values > 1.0 accelerate aging promotion. Values < 1.0 slow down aging promotion.
Implementations§
Source§impl PendingSync
impl PendingSync
Sourcepub fn new(data: Vec<u8>, qos_class: QoSClass, data_type: DataType) -> Self
pub fn new(data: Vec<u8>, qos_class: QoSClass, data_type: DataType) -> Self
Create a new pending sync item
Sourcepub fn with_multiplier(
data: Vec<u8>,
qos_class: QoSClass,
data_type: DataType,
multiplier: f32,
) -> Self
pub fn with_multiplier( data: Vec<u8>, qos_class: QoSClass, data_type: DataType, multiplier: f32, ) -> Self
Create with custom priority multiplier
Sourcepub fn queue_duration(&self) -> Duration
pub fn queue_duration(&self) -> Duration
Get the time this item has been queued
Sourcepub fn effective_class(&self) -> QoSClass
pub fn effective_class(&self) -> QoSClass
Get effective priority considering aging
Returns the potentially-promoted QoS class based on wait time.
Sourcepub fn should_promote(&self) -> bool
pub fn should_promote(&self) -> bool
Check if this item should be promoted due to aging
Trait Implementations§
Source§impl Clone for PendingSync
impl Clone for PendingSync
Source§fn clone(&self) -> PendingSync
fn clone(&self) -> PendingSync
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 PendingSync
impl RefUnwindSafe for PendingSync
impl Send for PendingSync
impl Sync for PendingSync
impl Unpin for PendingSync
impl UnsafeUnpin for PendingSync
impl UnwindSafe for PendingSync
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