pub struct PagerRange<T: PagerBacked, U: PagerRequestType> { /* private fields */ }Expand description
The requested range from a pager packet. This object ensures that all pager requests receive a response.
Implementations§
Source§impl<T: PagerBacked> PagerRange<T, PageInRequest>
impl<T: PagerBacked> PagerRange<T, PageInRequest>
Sourcepub fn new(
range: Range<u64>,
file: Arc<T>,
epoch_guard: EpochGuard<'static>,
) -> Self
pub fn new( range: Range<u64>, file: Arc<T>, epoch_guard: EpochGuard<'static>, ) -> Self
Constructs a new PageInRange<T>. range must be page aligned.
Sourcepub fn supply_pages(self, transfer_vmo: &Vmo, transfer_offset: u64)
pub fn supply_pages(self, transfer_vmo: &Vmo, transfer_offset: u64)
Supplies pages to the kernel for this range. See zx_pager_supply_pages for more
information.
Source§impl<T: PagerBacked> PagerRange<T, MarkDirtyRequest>
impl<T: PagerBacked> PagerRange<T, MarkDirtyRequest>
Source§impl<T: PagerBacked, U: PagerRequestType> PagerRange<T, U>
impl<T: PagerBacked, U: PagerRequestType> PagerRange<T, U>
Sourcepub fn split(self, split_point: u64) -> (Option<Self>, Option<Self>)
pub fn split(self, split_point: u64) -> (Option<Self>, Option<Self>)
Splits the underlying range allowing for different parts of the range to be handled and
responded to independently. See RangeExt::split for how splitting a range works.
split_point must be page aligned.
Sourcepub fn expand(self, new_range: Range<u64>) -> Self
pub fn expand(self, new_range: Range<u64>) -> Self
Increases the size of the range that will be responded to. Panics if the current range is
not a subset of new_range. new_range must be page aligned.
Sourcepub fn chunks(self, chunk_size: u64) -> PagerRangeChunksIter<T, U> ⓘ
pub fn chunks(self, chunk_size: u64) -> PagerRangeChunksIter<T, U> ⓘ
Returns an iterator that splits the range into ranges of chunk_size. If the length of the
range is not a multiple of chunk_size then the last chunk won’t be of length chunk_size.
The returned iterator will panic if it’s dropped without being fully consumed. chunk_size
must a multiple of the page size.
pub fn start(&self) -> u64
pub fn end(&self) -> u64
pub fn len(&self) -> u64
pub fn range(&self) -> Range<u64> ⓘ
Sourcepub fn report_failure(self, status: Status)
pub fn report_failure(self, status: Status)
Notifies the kernel that the page request for this range has failed. See ZX_PAGER_OP_FAIL
for more information.
Trait Implementations§
Source§impl<T: PagerBacked, U: PagerRequestType> Drop for PagerRange<T, U>
impl<T: PagerBacked, U: PagerRequestType> Drop for PagerRange<T, U>
Auto Trait Implementations§
impl<T, U> Freeze for PagerRange<T, U>
impl<T, U> !RefUnwindSafe for PagerRange<T, U>
impl<T, U> Send for PagerRange<T, U>where
U: Send,
impl<T, U> Sync for PagerRange<T, U>where
U: Sync,
impl<T, U> Unpin for PagerRange<T, U>where
U: Unpin,
impl<T, U> UnsafeUnpin for PagerRange<T, U>
impl<T, U> !UnwindSafe for PagerRange<T, U>
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, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to [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