pub struct Files<S: ?Sized, D: DeliveryHandler> { /* private fields */ }Expand description
A thread-safe registry of active File instances indexed by their Zircon pager port key.
Implementations§
Source§impl<S: BlockService + ?Sized, D: DeliveryHandler> Files<S, D>
impl<S: BlockService + ?Sized, D: DeliveryHandler> Files<S, D>
Sourcepub fn new(service: Arc<S>, delivery_handler: D, port: Port) -> Self
pub fn new(service: Arc<S>, delivery_handler: D, port: Port) -> Self
Creates a new file registry with the provided block service, delivery handler, and port.
Sourcepub fn start_recording(&self) -> Result<(), Status>
pub fn start_recording(&self) -> Result<(), Status>
Starts recording a profile of page requests serviced by self.
While active, each serviced page request records a FileMessage containing the file’s
Zircon pager port key and the readahead-aligned uncompressed logical byte offset within
that file.
Returns Err(zx::Status::BAD_STATE) if a recording is already active.
pub fn is_recording(&self) -> bool
Sourcepub fn stop_recording(&self) -> Result<Vmo, Status>
pub fn stop_recording(&self) -> Result<Vmo, Status>
Stops the active profile recording and returns a VMO containing the recorded
FileMessage items.
Returns Err(zx::Status::BAD_STATE) if no recording is active.
Sourcepub fn abort_recording(&self)
pub fn abort_recording(&self)
Aborts any active profile recording.
Sourcepub fn spawn_pager_thread(self: &Arc<Self>) -> PagerThread<S, D>where
S: 'static,
pub fn spawn_pager_thread(self: &Arc<Self>) -> PagerThread<S, D>where
S: 'static,
Spawns a background thread to service pager requests for self.
Sourcepub fn register_blob(
&self,
key: u64,
merkle_leaves: &[[u8; 32]],
read_alignment: usize,
) -> Result<(), Error>
pub fn register_blob( &self, key: u64, merkle_leaves: &[[u8; 32]], read_alignment: usize, ) -> Result<(), Error>
Registers a blob’s Merkle tree leaf hashes and delivery read alignment with the downstream delivery handler.
Sourcepub fn begin_loading(&self, key: u64)
pub fn begin_loading(&self, key: u64)
Marks key as currently loading metadata, preserving any page requests that arrived
prior to the mapping command.
Sourcepub fn get_file(&self, key: u64) -> Option<Arc<File>>
pub fn get_file(&self, key: u64) -> Option<Arc<File>>
Returns the loaded File registered under key, if present.
Source§impl<S: BlockService + ?Sized> Files<S, NoopDeliveryHandler>
impl<S: BlockService + ?Sized> Files<S, NoopDeliveryHandler>
Sourcepub fn new_without_pager(service: Arc<S>) -> Self
pub fn new_without_pager(service: Arc<S>) -> Self
Creates a file registry without a pager for intermediate (e.g. partition) sessions.
Auto Trait Implementations§
impl<S, D> !Freeze for Files<S, D>
impl<S, D> !RefUnwindSafe for Files<S, D>
impl<S, D> !UnwindSafe for Files<S, D>
impl<S, D> Send for Files<S, D>
impl<S, D> Sync for Files<S, D>
impl<S, D> Unpin for Files<S, D>
impl<S, D> UnsafeUnpin for Files<S, D>where
S: ?Sized,
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
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
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