pub trait NonMetaStorage:
Send
+ Sync
+ Sized
+ 'static {
// Required methods
fn open(
&self,
blob: &Hash,
flags: OpenFlags,
scope: ExecutionScope,
server_end: ServerEnd<NodeMarker>,
) -> Result<(), NonMetaStorageError>;
fn open3(
&self,
_blob: &Hash,
_flags: Flags,
_scope: ExecutionScope,
_object_request: ObjectRequestRef<'_>,
) -> Result<(), Status>;
fn get_blob_vmo(
&self,
hash: &Hash,
) -> impl Future<Output = Result<Vmo, NonMetaStorageError>> + Send;
fn read_blob(
&self,
hash: &Hash,
) -> impl Future<Output = Result<Vec<u8>, NonMetaStorageError>> + Send;
}
Expand description
The storage that provides the non-meta files (accessed by hash) of a package-directory (e.g. blobfs).
Required Methods§
Sourcefn open(
&self,
blob: &Hash,
flags: OpenFlags,
scope: ExecutionScope,
server_end: ServerEnd<NodeMarker>,
) -> Result<(), NonMetaStorageError>
fn open( &self, blob: &Hash, flags: OpenFlags, scope: ExecutionScope, server_end: ServerEnd<NodeMarker>, ) -> Result<(), NonMetaStorageError>
Open a non-meta file by hash. scope
may complete while there are still open connections.
fn open3( &self, _blob: &Hash, _flags: Flags, _scope: ExecutionScope, _object_request: ObjectRequestRef<'_>, ) -> Result<(), Status>
Sourcefn get_blob_vmo(
&self,
hash: &Hash,
) -> impl Future<Output = Result<Vmo, NonMetaStorageError>> + Send
fn get_blob_vmo( &self, hash: &Hash, ) -> impl Future<Output = Result<Vmo, NonMetaStorageError>> + Send
Get a read-only VMO for the blob.
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.
Implementations on Foreign Types§
Source§impl NonMetaStorage for Client
impl NonMetaStorage for Client
fn open( &self, blob: &Hash, flags: OpenFlags, scope: ExecutionScope, server_end: ServerEnd<NodeMarker>, ) -> Result<(), NonMetaStorageError>
fn open3( &self, blob: &Hash, flags: Flags, scope: ExecutionScope, object_request: ObjectRequestRef<'_>, ) -> Result<(), Status>
async fn get_blob_vmo(&self, hash: &Hash) -> Result<Vmo, NonMetaStorageError>
async fn read_blob(&self, hash: &Hash) -> Result<Vec<u8>, NonMetaStorageError>
Source§impl NonMetaStorage for DirectoryProxy
impl NonMetaStorage for DirectoryProxy
Assumes the directory is a flat container and the files are named after their hashes.