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§
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>
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.