Struct UploadStaging
pub struct UploadStaging { /* private fields */ }Expand description
The uploads one connection has begun and not yet committed.
Implementations§
Source§impl UploadStaging
impl UploadStaging
pub fn new(budget: Arc<UploadBudget>) -> Self
Sourcepub fn begin(
&mut self,
now: Instant,
request: BeginRequest,
) -> Result<String, JsonRpcError>
pub fn begin( &mut self, now: Instant, request: BeginRequest, ) -> Result<String, JsonRpcError>
Stage a new upload and return its id.
Sourcepub fn chunk(
&mut self,
now: Instant,
upload_id: &str,
offset: u64,
chunk: &[u8],
) -> Result<u64, JsonRpcError>
pub fn chunk( &mut self, now: Instant, upload_id: &str, offset: u64, chunk: &[u8], ) -> Result<u64, JsonRpcError>
Append one chunk at offset and return the bytes received so far.
Sourcepub fn take_complete(
&mut self,
now: Instant,
upload_id: &str,
) -> Result<CompletedUpload, JsonRpcError>
pub fn take_complete( &mut self, now: Instant, upload_id: &str, ) -> Result<CompletedUpload, JsonRpcError>
Remove a fully received upload for persistence. An incomplete or mismatched upload stays staged so the client can finish or retry it.
Sourcepub fn binding(&self, upload_id: &str) -> Option<UploadTarget>
pub fn binding(&self, upload_id: &str) -> Option<UploadTarget>
The session incarnation an upload was begun for, for re-authorization before commit.
Trait Implementations§
Source§impl Debug for UploadStaging
impl Debug for UploadStaging
Auto Trait Implementations§
impl Freeze for UploadStaging
impl RefUnwindSafe for UploadStaging
impl Send for UploadStaging
impl Sync for UploadStaging
impl Unpin for UploadStaging
impl UnsafeUnpin for UploadStaging
impl UnwindSafe for UploadStaging
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more