pub trait PackageCache:
Send
+ Sync
+ Debug {
// Required methods
fn lookup<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 WebcHash,
) -> Pin<Box<dyn Future<Output = Result<Option<Container>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
webc: Bytes,
dist: &'life1 DistributionInfo,
) -> Pin<Box<dyn Future<Output = Result<Container, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Persistent storage for immutable WEBC package contents.
Required Methods§
Sourcefn lookup<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 WebcHash,
) -> Pin<Box<dyn Future<Output = Result<Option<Container>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn lookup<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 WebcHash,
) -> Pin<Box<dyn Future<Output = Result<Option<Container>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load and decode a package by its expected content hash.
Sourcefn save<'life0, 'life1, 'async_trait>(
&'life0 self,
webc: Bytes,
dist: &'life1 DistributionInfo,
) -> Pin<Box<dyn Future<Output = Result<Container, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
webc: Bytes,
dist: &'life1 DistributionInfo,
) -> Pin<Box<dyn Future<Output = Result<Container, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Persist downloaded bytes and return a decoded container.