Trait PuffinReader

Source
pub trait PuffinReader {
    type Blob: BlobGuard;
    type Dir: DirGuard;

    // Required methods
    fn with_file_size_hint(self, file_size_hint: Option<u64>) -> Self;
    fn metadata<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Arc<FileMetadata>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn blob<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<GuardWithMetadata<Self::Blob>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn dir<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<GuardWithMetadata<Self::Dir>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

The PuffinReader trait provides methods for reading blobs and directories from a Puffin file.

Required Associated Types§

Required Methods§

Source

fn with_file_size_hint(self, file_size_hint: Option<u64>) -> Self

Source

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

Returns the metadata of the Puffin file.

Source

fn blob<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<GuardWithMetadata<Self::Blob>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Reads a blob from the Puffin file.

The returned GuardWithMetadata is used to access the blob data and its metadata. Users should hold the GuardWithMetadata until they are done with the blob data.

Source

fn dir<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<GuardWithMetadata<Self::Dir>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Reads a directory from the Puffin file.

The returned GuardWithMetadata is used to access the directory data and its metadata. Users should hold the GuardWithMetadata until they are done with the directory data.

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<S, F> PuffinReader for FsPuffinReader<S, F>
where F: PuffinFileAccessor + Clone, S: Stager<FileHandle = F::FileHandle> + 'static,