pub trait Stager: Send + Sync {
type Blob: BlobGuard + Sync;
type Dir: DirGuard;
type FileHandle: ToString + Clone + Send + Sync;
// Required methods
fn get_blob<'a, 'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
handle: &'life1 Self::FileHandle,
key: &'life2 str,
init_factory: Box<dyn InitBlobFn + Send + Sync + 'a>,
) -> Pin<Box<dyn Future<Output = Result<Self::Blob>> + Send + 'async_trait>>
where Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn get_dir<'a, 'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
handle: &'life1 Self::FileHandle,
key: &'life2 str,
init_fn: Box<dyn InitDirFn + Send + Sync + 'a>,
) -> Pin<Box<dyn Future<Output = Result<(Self::Dir, DirMetrics)>> + Send + 'async_trait>>
where Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn put_dir<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
handle: &'life1 Self::FileHandle,
key: &'life2 str,
dir_path: PathBuf,
dir_size: u64,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn purge<'life0, 'life1, 'async_trait>(
&'life0 self,
handle: &'life1 Self::FileHandle,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Stager manages the staging area for the puffin files.
Required Associated Types§
type Blob: BlobGuard + Sync
type Dir: DirGuard
type FileHandle: ToString + Clone + Send + Sync
Required Methods§
Sourcefn get_blob<'a, 'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
handle: &'life1 Self::FileHandle,
key: &'life2 str,
init_factory: Box<dyn InitBlobFn + Send + Sync + 'a>,
) -> Pin<Box<dyn Future<Output = Result<Self::Blob>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_blob<'a, 'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
handle: &'life1 Self::FileHandle,
key: &'life2 str,
init_factory: Box<dyn InitBlobFn + Send + Sync + 'a>,
) -> Pin<Box<dyn Future<Output = Result<Self::Blob>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Retrieves a blob, initializing it if necessary using the provided init_fn.
The returned BlobGuard is used to access the blob reader.
The caller is responsible for holding the BlobGuard until they are done with the blob.
Sourcefn get_dir<'a, 'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
handle: &'life1 Self::FileHandle,
key: &'life2 str,
init_fn: Box<dyn InitDirFn + Send + Sync + 'a>,
) -> Pin<Box<dyn Future<Output = Result<(Self::Dir, DirMetrics)>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_dir<'a, 'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
handle: &'life1 Self::FileHandle,
key: &'life2 str,
init_fn: Box<dyn InitDirFn + Send + Sync + 'a>,
) -> Pin<Box<dyn Future<Output = Result<(Self::Dir, DirMetrics)>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Retrieves a directory, initializing it if necessary using the provided init_fn.
The returned tuple contains the DirGuard and DirMetrics.
The 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.
Sourcefn put_dir<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
handle: &'life1 Self::FileHandle,
key: &'life2 str,
dir_path: PathBuf,
dir_size: u64,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put_dir<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
handle: &'life1 Self::FileHandle,
key: &'life2 str,
dir_path: PathBuf,
dir_size: u64,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Stores a directory in the staging area.