pub struct SessionScopedAttachmentStore { /* private fields */ }Expand description
Session-scoped wrapper that records a write-ahead intent in
AttachmentManifest before delegating each put to the backing
AttachmentStore. The intent row durably captures “this session
is about to write these bytes,” so if the process dies between
put and the next committed runtime state, a later GC sweep can
reconcile the orphaned bytes by walking
AttachmentManifest::list_uncommitted.
Constructed by the runtime when both a durable AttachmentStore
and a RuntimePersistence backend
(which also implements AttachmentManifest) are wired up. Other
callers — tests, hosts using only ephemeral storage — keep the
plain inner store and skip the manifest entirely.
Implementations§
Source§impl SessionScopedAttachmentStore
impl SessionScopedAttachmentStore
pub fn new( inner: Arc<dyn AttachmentStore>, manifest: Arc<dyn AttachmentManifest>, session_id: impl Into<String>, ) -> Self
pub fn inner(&self) -> &Arc<dyn AttachmentStore> ⓘ
pub fn manifest(&self) -> &Arc<dyn AttachmentManifest> ⓘ
Trait Implementations§
Source§impl AttachmentStore for SessionScopedAttachmentStore
impl AttachmentStore for SessionScopedAttachmentStore
fn persistence(&self) -> AttachmentStorePersistence
fn put( &self, bytes: Vec<u8>, meta: AttachmentCreateMeta, ) -> Result<AttachmentRef, AttachmentStoreError>
fn get( &self, id: &AttachmentId, ) -> Result<StoredAttachment, AttachmentStoreError>
Auto Trait Implementations§
impl !RefUnwindSafe for SessionScopedAttachmentStore
impl !UnwindSafe for SessionScopedAttachmentStore
impl Freeze for SessionScopedAttachmentStore
impl Send for SessionScopedAttachmentStore
impl Sync for SessionScopedAttachmentStore
impl Unpin for SessionScopedAttachmentStore
impl UnsafeUnpin for SessionScopedAttachmentStore
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