pub struct Pager { /* private fields */ }Implementations§
Source§impl Pager
Pager handles page requests. It is a per-volume object.
impl Pager
Pager handles page requests. It is a per-volume object.
Sourcepub fn new(scope: ExecutionScope) -> Result<Self, Error>
pub fn new(scope: ExecutionScope) -> Result<Self, Error>
Creates a new pager.
Sourcepub fn set_recorder(&self, recorder: Option<Box<dyn Recorder>>)
pub fn set_recorder(&self, recorder: Option<Box<dyn Recorder>>)
Set the current profile recorder, or set to None to not record.
Sourcepub fn recorder(&self) -> MutexGuard<'_, Option<Box<dyn Recorder>>>
pub fn recorder(&self) -> MutexGuard<'_, Option<Box<dyn Recorder>>>
Borrow the profile recorder. Used to record file opens.
Sourcepub fn record_page_in<P: PagerBacked>(&self, node: Arc<P>, range: Range<u64>)
pub fn record_page_in<P: PagerBacked>(&self, node: Arc<P>, range: Range<u64>)
Record a range into a profile if one is being recorded.
Sourcepub fn create_vmo<T: PagerBacked>(
&self,
file: Weak<T>,
initial_size: u64,
vmo_options: VmoOptions,
) -> Result<(Vmo, PagerPacketReceiverRegistration<T>), Error>
pub fn create_vmo<T: PagerBacked>( &self, file: Weak<T>, initial_size: u64, vmo_options: VmoOptions, ) -> Result<(Vmo, PagerPacketReceiverRegistration<T>), Error>
Creates a new VMO to be used with the pager.
Sourcepub fn watch_for_zero_children(
&self,
file: &impl PagerBacked,
) -> Result<bool, Error>
pub fn watch_for_zero_children( &self, file: &impl PagerBacked, ) -> Result<bool, Error>
Starts watching for the VMO_ZERO_CHILDREN signal on file’s vmo. Returns false if the
signal is already being watched for. When the pager receives the VMO_ZERO_CHILDREN signal
PagerBacked::on_zero_children will be called.
Sourcepub fn writeback_begin(
&self,
vmo: &Vmo,
range: Range<u64>,
options: PagerWritebackBeginOptions,
)
pub fn writeback_begin( &self, vmo: &Vmo, range: Range<u64>, options: PagerWritebackBeginOptions, )
Notifies the kernel that the filesystem has started cleaning the range of pages. See
ZX_PAGER_OP_WRITEBACK_BEGIN for more information.
Sourcepub fn writeback_end(&self, vmo: &Vmo, range: Range<u64>)
pub fn writeback_end(&self, vmo: &Vmo, range: Range<u64>)
Notifies the kernel that the filesystem has finished cleaning the range of pages. See
ZX_PAGER_OP_WRITEBACK_END for more information.
Sourcepub fn query_dirty_ranges(
&self,
vmo: &Vmo,
range: Range<u64>,
buffer: &mut [VmoDirtyRange],
) -> Result<(usize, usize), Status>
pub fn query_dirty_ranges( &self, vmo: &Vmo, range: Range<u64>, buffer: &mut [VmoDirtyRange], ) -> Result<(usize, usize), Status>
Queries the vmo for ranges that are dirty within range. Returns (num_returned, num_remaining) where num_returned is the number of objects populated in buffer and
num_remaining is the number of dirty ranges remaining in range that could not fit in
buffer. See zx_pager_query_dirty_ranges for more information.
Sourcepub fn query_vmo_stats(
&self,
vmo: &Vmo,
options: PagerVmoStatsOptions,
) -> Result<PagerVmoStats, Status>
pub fn query_vmo_stats( &self, vmo: &Vmo, options: PagerVmoStatsOptions, ) -> Result<PagerVmoStats, Status>
Queries the vmo for any pager related statistics. If
PagerVmoStatsOptions::RESET_VMO_STATS is passed then the stats will also be reset. See
zx_pager_query_vmo_stats for more information.
pub async fn page_in_barrier()
Auto Trait Implementations§
impl !Freeze for Pager
impl !RefUnwindSafe for Pager
impl Send for Pager
impl Sync for Pager
impl Unpin for Pager
impl !UnwindSafe for Pager
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