pub struct DiskPayloadStore { /* private fields */ }Expand description
PayloadStore that keeps offloaded payload blobs as files under
dir, with a background death-epoch sweeper.
The sweeper is spawned on construction and aborted on Drop; its
shutdown token is owned by the sweeper task and never cancelled by
the store. All sweeping runs on the real clock — it must observe
actual file ages (the decorator’s injectable test clock never
reaches the store).
Implementations§
Source§impl DiskPayloadStore
impl DiskPayloadStore
Sourcepub fn new(
dir: PathBuf,
sweep_interval: Duration,
shutdown_token: CancellationToken,
) -> Self
pub fn new( dir: PathBuf, sweep_interval: Duration, shutdown_token: CancellationToken, ) -> Self
Create a store writing blobs into dir (production clock).
The shutdown_token stops the background payload sweeper; it is
owned by the sweeper task and never cancelled by the store.
Trait Implementations§
Source§impl Debug for DiskPayloadStore
impl Debug for DiskPayloadStore
Source§impl Drop for DiskPayloadStore
impl Drop for DiskPayloadStore
Source§impl PayloadStore for DiskPayloadStore
impl PayloadStore for DiskPayloadStore
Source§fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Reclaim payload space now: best-effort unlink of every entry of
the payload dir. Unlink failures never turn clear into Err —
each failure WARNs and the rest of the dir is still attempted.
Source§fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
bytes: &'life2 [u8],
_death_epoch: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
bytes: &'life2 [u8],
_death_epoch: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Auto Trait Implementations§
impl !Freeze for DiskPayloadStore
impl !RefUnwindSafe for DiskPayloadStore
impl Send for DiskPayloadStore
impl Sync for DiskPayloadStore
impl Unpin for DiskPayloadStore
impl UnsafeUnpin for DiskPayloadStore
impl UnwindSafe for DiskPayloadStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more