Skip to main content

LayerObject

Trait LayerObject 

Source
pub trait LayerObject: ReadObjectHandle {
    // Provided methods
    fn as_slice(&self) -> Option<&[u8]> { ... }
    fn has_io_error(&self) -> bool { ... }
    fn purge_cached_data(&self) { ... }
    fn close<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

A handle for reading layer objects.

Provided Methods§

Source

fn as_slice(&self) -> Option<&[u8]>

Returns a memory-mapped slice of the entire layer file if supported (e.g. when backed by a pager-managed VMO).

Source

fn has_io_error(&self) -> bool

Returns true if an underlying I/O error occurred while paging in data for this object.

Source

fn purge_cached_data(&self)

Requests that cached data (such as paged-in pages) for this object be purged.

Source

fn close<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Called when the layer is closed to release any external resources (such as pager registrations).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: LayerObject + ?Sized> LayerObject for Arc<T>

Source§

fn as_slice(&self) -> Option<&[u8]>

Source§

fn has_io_error(&self) -> bool

Source§

fn purge_cached_data(&self)

Source§

fn close<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

impl<T: LayerObject + ?Sized> LayerObject for Box<T>

Source§

fn as_slice(&self) -> Option<&[u8]>

Source§

fn has_io_error(&self) -> bool

Source§

fn purge_cached_data(&self)

Source§

fn close<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§