pub struct Inspector { /* private fields */ }
Expand description
Root of the Inspect API. Through this API, further nodes can be created and inspect can be served.
Implementations§
Source§impl Inspector
impl Inspector
Sourcepub fn duplicate_vmo(&self) -> Option<Vmo>
pub fn duplicate_vmo(&self) -> Option<Vmo>
Returns a duplicate of the underlying VMO for this Inspector.
The duplicated VMO will be read-only, and is suitable to send to clients over FIDL.
Sourcepub fn duplicate_vmo_with_rights(&self, rights: Rights) -> Option<Vmo>
pub fn duplicate_vmo_with_rights(&self, rights: Rights) -> Option<Vmo>
Returns a duplicate of the underlying VMO for this Inspector with the given rights.
The duplicated VMO will be read-only, and is suitable to send to clients over FIDL.
Sourcepub fn frozen_vmo_copy(&self) -> Option<Vmo>
pub fn frozen_vmo_copy(&self) -> Option<Vmo>
This produces a copy-on-write VMO with a generation count marked as VMO_FROZEN. The resulting VMO is read-only.
Failure
This function returns None
for failure. That can happen for
a few reasons.
- It is a semantic error to freeze a VMO while an atomic transaction is in progress, because that transaction is supposed to be atomic.
- VMO errors. This can include running out of space or debug assertions.
Note: the generation count for the original VMO is updated immediately. Since the new VMO is page-by-page copy-on-write, at least the first page of the VMO will immediately do a true copy. The practical implications of this depend on implementation details like how large a VMO is versus page size.
Source§impl Inspector
impl Inspector
Sourcepub fn new(conf: InspectorConfig) -> Self
pub fn new(conf: InspectorConfig) -> Self
Initializes a new Inspect VMO object with the
default maximum size
.
Sourcepub fn copy_vmo_data(&self) -> Option<Vec<u8>>
pub fn copy_vmo_data(&self) -> Option<Vec<u8>>
Returns a copy of the bytes stored in the VMO for this inspector.
The output will be truncated to only those bytes that are needed to accurately read the stored data.
pub fn max_size(&self) -> Option<usize>
Sourcepub fn atomic_update<F, R>(&self, update_fn: F) -> R
pub fn atomic_update<F, R>(&self, update_fn: F) -> R
Takes a function to execute as under a single lock of the Inspect VMO. This function receives a reference to the root of the inspect hierarchy.
Trait Implementations§
Source§impl DiagnosticsHierarchyGetter<String> for Inspector
impl DiagnosticsHierarchyGetter<String> for Inspector
fn get_diagnostics_hierarchy(&self) -> Cow<'_, DiagnosticsHierarchy>
Source§impl InspectorExt for Inspector
impl InspectorExt for Inspector
Source§fn record_lazy_stats(&self)
fn record_lazy_stats(&self)
Inspector
stats.Source§impl ReadableTree for Inspector
impl ReadableTree for Inspector
Source§fn vmo<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vmo, ReaderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn vmo<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vmo, ReaderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl Freeze for Inspector
impl !RefUnwindSafe for Inspector
impl Send for Inspector
impl Sync for Inspector
impl Unpin for Inspector
impl !UnwindSafe for Inspector
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)