pub struct MultipartStateStore { /* private fields */ }Expand description
In-memory side-table mapping upload_id → context. One of these
hangs off S4Service (always-on, no flag — the per-upload state is
gateway-internal).
Implementations§
Source§impl MultipartStateStore
impl MultipartStateStore
Sourcepub fn new() -> Self
pub fn new() -> Self
Empty store. Use Arc<MultipartStateStore> so S4Service’s
async handlers can borrow it across &self calls without
requiring Clone.
Sourcepub fn put(&self, upload_id: &str, ctx: MultipartUploadContext)
pub fn put(&self, upload_id: &str, ctx: MultipartUploadContext)
Register a new upload under upload_id. If upload_id is
already present (extremely unlikely — backend issues fresh ids)
the previous entry is overwritten silently to mirror
HashMap::insert’s replace-on-collision semantics.
Sourcepub fn get(&self, upload_id: &str) -> Option<MultipartUploadContext>
pub fn get(&self, upload_id: &str) -> Option<MultipartUploadContext>
Snapshot the context for upload_id. None when no entry was
registered (e.g. Complete arrived for an upload that the gateway
has no record of — passes through to the backend untouched, which
in turn surfaces NoSuchUpload).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MultipartStateStore
impl RefUnwindSafe for MultipartStateStore
impl Send for MultipartStateStore
impl Sync for MultipartStateStore
impl Unpin for MultipartStateStore
impl UnsafeUnpin for MultipartStateStore
impl UnwindSafe for MultipartStateStore
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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