Trait PagedObjectStore

Source
pub trait PagedObjectStore {
    // Required methods
    async fn create_object(&self, id: ObjID) -> Result<()>;
    async fn delete_object(&self, id: ObjID) -> Result<()>;
    async fn len(&self, id: ObjID) -> Result<u64>;
    async fn read_object(
        &self,
        id: ObjID,
        offset: u64,
        buf: &mut [u8],
    ) -> Result<usize>;
    async fn write_object(
        &self,
        id: ObjID,
        offset: u64,
        buf: &[u8],
    ) -> Result<()>;
    async fn page_in_object<'a>(
        &self,
        id: ObjID,
        reqs: &'a mut [PageRequest],
    ) -> Result<usize>;
    async fn page_out_object<'a>(
        &self,
        id: ObjID,
        reqs: &'a mut [PageRequest],
    ) -> Result<usize>;

    // Provided methods
    async fn get_config_id(&self) -> Result<ObjID> { ... }
    async fn set_config_id(&self, id: ObjID) -> Result<()> { ... }
    async fn flush(&self) -> Result<()> { ... }
    async fn enumerate_external(&self, _id: ObjID) -> Result<Vec<ExternalFile>> { ... }
    async fn find_external(&self, _id: ObjID) -> Result<usize> { ... }
}

Required Methods§

Source

async fn create_object(&self, id: ObjID) -> Result<()>

Source

async fn delete_object(&self, id: ObjID) -> Result<()>

Source

async fn len(&self, id: ObjID) -> Result<u64>

Source

async fn read_object( &self, id: ObjID, offset: u64, buf: &mut [u8], ) -> Result<usize>

Source

async fn write_object(&self, id: ObjID, offset: u64, buf: &[u8]) -> Result<()>

Source

async fn page_in_object<'a>( &self, id: ObjID, reqs: &'a mut [PageRequest], ) -> Result<usize>

Source

async fn page_out_object<'a>( &self, id: ObjID, reqs: &'a mut [PageRequest], ) -> Result<usize>

Provided Methods§

Source

async fn get_config_id(&self) -> Result<ObjID>

Source

async fn set_config_id(&self, id: ObjID) -> Result<()>

Source

async fn flush(&self) -> Result<()>

Source

async fn enumerate_external(&self, _id: ObjID) -> Result<Vec<ExternalFile>>

Source

async fn find_external(&self, _id: ObjID) -> Result<usize>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<D: Device> PagedObjectStore for Ext4Store<D>