pub struct FileScheduler { /* private fields */ }
Expand description
A throttled file reader
Implementations§
Source§impl FileScheduler
impl FileScheduler
Sourcepub fn submit_request(
&self,
request: Vec<Range<u64>>,
priority: u64,
) -> impl Future<Output = Result<Vec<Bytes>>> + Send
pub fn submit_request( &self, request: Vec<Range<u64>>, priority: u64, ) -> impl Future<Output = Result<Vec<Bytes>>> + Send
Submit a batch of I/O requests to the reader
The requests will be queued in a FIFO manner and, when all requests have been fulfilled, the returned future will be completed.
Each request has a given priority. If the I/O loop is full then requests will be buffered and requests with the lowest priority will be released from the buffer first.
Each request has a backpressure ID which controls which backpressure throttle is applied to the request. Requests made to the same backpressure throttle will be throttled together.
Sourcepub fn submit_single(
&self,
range: Range<u64>,
priority: u64,
) -> impl Future<Output = Result<Bytes>> + Send
pub fn submit_single( &self, range: Range<u64>, priority: u64, ) -> impl Future<Output = Result<Bytes>> + Send
Submit a single IOP to the reader
If you have multiple IOPS to perform then Self::submit_request
is going
to be more efficient.
See Self::submit_request
for more information on the priority and backpressure.
Trait Implementations§
Source§impl Clone for FileScheduler
impl Clone for FileScheduler
Source§fn clone(&self) -> FileScheduler
fn clone(&self) -> FileScheduler
Returns a copy 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 FileScheduler
impl !RefUnwindSafe for FileScheduler
impl Send for FileScheduler
impl Sync for FileScheduler
impl Unpin for FileScheduler
impl !UnwindSafe for FileScheduler
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 moreCreates a shared type from an unshared type.