struct ImageRequest {
inner: ImageLoaderRequest,
priority: ImageRequestPriority,
result_sender: Sender<Result<Image, ImageError>>,
retries_count: u8,
task_handle: Arc<Mutex<Option<JoinHandle<()>>>>,
stalled_timeout_source: Arc<Mutex<Option<SourceId>>>,
}Expand description
A request for an image.
Fields§
§inner: ImageLoaderRequestThe request to the image loader.
priority: ImageRequestPriorityThe priority of the request.
result_sender: Sender<Result<Image, ImageError>>The sender of the channel to use to send the result.
retries_count: u8The number of retries for this request.
task_handle: Arc<Mutex<Option<JoinHandle<()>>>>The handle for aborting the current task of this request.
stalled_timeout_source: Arc<Mutex<Option<SourceId>>>The timeout source for marking this request as stalled.
Implementations§
Source§impl ImageRequest
impl ImageRequest
Sourcefn new(
inner: ImageLoaderRequest,
priority: ImageRequestPriority,
) -> (Self, Receiver<Result<Image, ImageError>>)
fn new( inner: ImageLoaderRequest, priority: ImageRequestPriority, ) -> (Self, Receiver<Result<Image, ImageError>>)
Construct an image request with the given data and priority.
Sourcefn can_retry(retries_count: u8, error: ImageError) -> bool
fn can_retry(retries_count: u8, error: ImageError) -> bool
Whether we can retry a request with the given retries count and after the given error.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ImageRequest
impl !RefUnwindSafe for ImageRequest
impl Send for ImageRequest
impl Sync for ImageRequest
impl Unpin for ImageRequest
impl UnsafeUnpin for ImageRequest
impl !UnwindSafe for ImageRequest
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, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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