Skip to main content

PagerRange

Struct PagerRange 

Source
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>

Source

pub fn new( range: Range<u64>, file: Arc<T>, epoch_guard: EpochGuard<'static>, ) -> Self

Constructs a new PageInRange<T>. range must be page aligned.

Source

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>

Source

pub fn new(range: Range<u64>, file: Arc<T>) -> Self

Constructs a new MarkDirtyRange<T>. range must be page aligned.

Source

pub fn dirty_pages(self)

Allows the kernel to dirty this range of pages. See ZX_PAGER_OP_DIRTY for more information.

Source§

impl<T: PagerBacked, U: PagerRequestType> PagerRange<T, U>

Source

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.

Source

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.

Source

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.

Source

pub fn start(&self) -> u64

Source

pub fn end(&self) -> u64

Source

pub fn len(&self) -> u64

Source

pub fn range(&self) -> Range<u64>

Source

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>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

Source§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl<T, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

Source§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> InstanceFromServiceTransport<T> for T

§

fn from_service_transport(handle: T) -> T

Converts the given service transport handle of type T to [Self]
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoAny for T
where T: 'static + Send + Sync,

Source§

fn into_any(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Cast the given object into a dyn std::any::Any.
Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<E> RunsTransport<Mpsc> for E

§

impl<E> RunsTransport<Mpsc> for E
where E: RunsTransport<Mpsc>,