struct ImageRequestQueueInner {
limit: usize,
requests: HashMap<ImageRequestId, ImageRequest>,
ongoing: HashSet<ImageRequestId>,
stalled: HashSet<ImageRequestId>,
queue_default: VecDeque<ImageRequestId>,
queue_low: VecDeque<ImageRequestId>,
}
Fields§
§limit: usize
The current limit of the ongoing requests count.
This may change if an error is encountered, to let the system recover.
requests: HashMap<ImageRequestId, ImageRequest>
The image requests in the queue.
ongoing: HashSet<ImageRequestId>
The ongoing requests.
stalled: HashSet<ImageRequestId>
The stalled requests.
queue_default: VecDeque<ImageRequestId>
The queue of requests with default priority.
queue_low: VecDeque<ImageRequestId>
The queue of requests with low priority.
Implementations§
Source§impl ImageRequestQueueInner
impl ImageRequestQueueInner
Sourcefn is_limit_reached(&self) -> bool
fn is_limit_reached(&self) -> bool
Whether we have reache the current limit of concurrent requests.
Sourcefn add_request(&mut self, request_id: ImageRequestId, request: ImageRequest)
fn add_request(&mut self, request_id: ImageRequestId, request: ImageRequest)
Add the given request to the queue.
Sourcefn add_download_request(
&mut self,
client: Client,
settings: MediaRequestParameters,
dimensions: Option<FrameDimensions>,
priority: ImageRequestPriority,
) -> ImageRequestHandle
fn add_download_request( &mut self, client: Client, settings: MediaRequestParameters, dimensions: Option<FrameDimensions>, priority: ImageRequestPriority, ) -> ImageRequestHandle
Add a request to download an image.
If another request for the same image already exists, this will reuse the same request.
Sourcefn add_file_request(
&mut self,
file: File,
dimensions: Option<FrameDimensions>,
) -> ImageRequestHandle
fn add_file_request( &mut self, file: File, dimensions: Option<FrameDimensions>, ) -> ImageRequestHandle
Add a request to load an image from a file.
If another request for the same file already exists, this will reuse the same request.
Sourcefn mark_as_stalled(&mut self, request_id: ImageRequestId)
fn mark_as_stalled(&mut self, request_id: ImageRequestId)
Mark the request with the given ID as stalled.
Sourcefn retry_request(&mut self, request_id: &ImageRequestId, lower_limit: bool)
fn retry_request(&mut self, request_id: &ImageRequestId, lower_limit: bool)
Retry the request with the given ID.
If lower_limit
is true
, we will also lower the limit of the queue.
Sourcefn remove_request(&mut self, request_id: &ImageRequestId)
fn remove_request(&mut self, request_id: &ImageRequestId)
Remove the request with the given ID.
Sourcefn spawn_next(&mut self)
fn spawn_next(&mut self)
Spawn as many requests as possible.
Auto Trait Implementations§
impl Freeze for ImageRequestQueueInner
impl !RefUnwindSafe for ImageRequestQueueInner
impl Send for ImageRequestQueueInner
impl Sync for ImageRequestQueueInner
impl Unpin for ImageRequestQueueInner
impl !UnwindSafe for ImageRequestQueueInner
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
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>
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>
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