package_directory

Trait NonMetaStorage

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

Source

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.

Source

fn open3( &self, _blob: &Hash, _flags: Flags, _scope: ExecutionScope, _object_request: ObjectRequestRef<'_>, ) -> Result<(), Status>

Source

fn get_blob_vmo( &self, hash: &Hash, ) -> impl Future<Output = Result<Vmo, NonMetaStorageError>> + Send

Get a read-only VMO for the blob.

Source

fn read_blob( &self, hash: &Hash, ) -> impl Future<Output = Result<Vec<u8>, NonMetaStorageError>> + Send

Reads the contents of a 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

Source§

fn open( &self, blob: &Hash, flags: OpenFlags, scope: ExecutionScope, server_end: ServerEnd<NodeMarker>, ) -> Result<(), NonMetaStorageError>

Source§

fn open3( &self, blob: &Hash, flags: Flags, scope: ExecutionScope, object_request: ObjectRequestRef<'_>, ) -> Result<(), Status>

Source§

async fn get_blob_vmo(&self, hash: &Hash) -> Result<Vmo, NonMetaStorageError>

Source§

async fn read_blob(&self, hash: &Hash) -> Result<Vec<u8>, NonMetaStorageError>

Source§

impl NonMetaStorage for DirectoryProxy

Assumes the directory is a flat container and the files are named after their hashes.

Source§

fn open( &self, blob: &Hash, flags: OpenFlags, _scope: ExecutionScope, server_end: ServerEnd<NodeMarker>, ) -> Result<(), NonMetaStorageError>

Source§

fn open3( &self, blob: &Hash, flags: Flags, _scope: ExecutionScope, object_request: ObjectRequestRef<'_>, ) -> Result<(), Status>

Source§

async fn get_blob_vmo(&self, hash: &Hash) -> Result<Vmo, NonMetaStorageError>

Source§

async fn read_blob(&self, hash: &Hash) -> Result<Vec<u8>, NonMetaStorageError>

Implementors§