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<BlobWithMetadata<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<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§
fn with_file_size_hint(self, file_size_hint: Option<u64>) -> Self
Sourcefn 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 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.
Sourcefn blob<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<BlobWithMetadata<Self::Blob>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn blob<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<BlobWithMetadata<Self::Blob>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Reads a blob from the Puffin file.
The returned BlobWithMetadata
is used to access the blob data and its metadata.
Users should hold the BlobWithMetadata
until they are done with the blob data.
Sourcefn dir<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Self::Dir>> + 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<Self::Dir>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Reads a directory from the Puffin file.
The returned DirGuard
is used to access the directory in the filesystem.
The caller is responsible for holding the DirGuard
until they are done with the directory.
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.