pub struct QueuedRequest {
pub id: String,
pub request_type: QueuedRequestType,
pub priority: RequestPriority,
pub queued_at: Option<Instant>,
pub queued_timestamp: u64,
pub timeout: Duration,
pub retry_count: u32,
pub max_retries: u32,
}Expand description
A queued request waiting for network connectivity
Fields§
§id: StringUnique request ID
request_type: QueuedRequestTypeRequest type
priority: RequestPriorityPriority level
queued_at: Option<Instant>When the request was queued
queued_timestamp: u64Serialized timestamp for persistence
timeout: DurationRequest timeout
retry_count: u32Number of retry attempts
max_retries: u32Maximum retry attempts
Implementations§
Source§impl QueuedRequest
impl QueuedRequest
Sourcepub fn new(
id: String,
request_type: QueuedRequestType,
priority: RequestPriority,
timeout: Duration,
) -> Self
pub fn new( id: String, request_type: QueuedRequestType, priority: RequestPriority, timeout: Duration, ) -> Self
Create a new queued request
Sourcepub fn is_expired(&self, max_age: Duration) -> bool
pub fn is_expired(&self, max_age: Duration) -> bool
Check if request has expired
Sourcepub fn is_timed_out(&self) -> bool
pub fn is_timed_out(&self) -> bool
Check if request has timed out
Sourcepub fn should_retry(&self) -> bool
pub fn should_retry(&self) -> bool
Check if should retry
Trait Implementations§
Source§impl Clone for QueuedRequest
impl Clone for QueuedRequest
Source§fn clone(&self) -> QueuedRequest
fn clone(&self) -> QueuedRequest
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 moreSource§impl Debug for QueuedRequest
impl Debug for QueuedRequest
Source§impl<'de> Deserialize<'de> for QueuedRequest
impl<'de> Deserialize<'de> for QueuedRequest
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
Auto Trait Implementations§
impl Freeze for QueuedRequest
impl RefUnwindSafe for QueuedRequest
impl Send for QueuedRequest
impl Sync for QueuedRequest
impl Unpin for QueuedRequest
impl UnwindSafe for QueuedRequest
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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