Skip to main content

MemoryUpload

Struct MemoryUpload 

Source
pub struct MemoryUpload { /* private fields */ }
Expand description

Handle to a single in-memory upload.

Trait Implementations§

Source§

impl SendUpload for MemoryUpload

Source§

async fn write_chunk( &mut self, offset: u64, reader: &mut (dyn AsyncRead + Unpin + Send), ) -> Result<u64, TusError>

Write chunk data starting at offset, streaming from reader. Returns the number of bytes written.
Source§

async fn get_info(&self) -> Result<UploadInfo, TusError>

Retrieve current metadata and offset.
Source§

async fn finalize(&mut self) -> Result<(), TusError>

Called once all bytes have been received (offset == size).
Source§

async fn delete(self) -> Result<(), TusError>

Delete this upload and free all associated resources. Called by the termination extension (DELETE). Return Err if unsupported.
Source§

async fn declare_length(&mut self, length: u64) -> Result<(), TusError>

Set the definitive Upload-Length on a deferred-length upload. Called when the client provides Upload-Length on a PATCH request.
Source§

async fn read_content( &self, ) -> Result<Box<dyn AsyncRead + Send + Unpin>, TusError>

Stream the completed upload bytes for HTTP GET (download) requests. Return TusError::UploadNotReadyForDownload when the upload is incomplete or not readable.
Source§

async fn concatenate(&mut self, partials: &[UploadInfo]) -> Result<(), TusError>

Assemble fully-uploaded partials (in order) into this final upload. Called by the concatenation extension.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<TraitVariantBlanketType> Upload for TraitVariantBlanketType
where TraitVariantBlanketType: SendUpload,

Source§

async fn write_chunk( &mut self, offset: u64, reader: &mut (dyn AsyncRead + Send + Unpin), ) -> Result<u64, TusError>

Write chunk data starting at offset, streaming from reader. Returns the number of bytes written.
Source§

async fn get_info(&self) -> Result<UploadInfo, TusError>

Retrieve current metadata and offset.
Source§

async fn finalize(&mut self) -> Result<(), TusError>

Called once all bytes have been received (offset == size).
Source§

async fn delete(self) -> Result<(), TusError>

Delete this upload and free all associated resources. Called by the termination extension (DELETE). Return Err if unsupported.
Source§

async fn declare_length(&mut self, length: u64) -> Result<(), TusError>

Set the definitive Upload-Length on a deferred-length upload. Called when the client provides Upload-Length on a PATCH request.
Source§

async fn concatenate(&mut self, partials: &[UploadInfo]) -> Result<(), TusError>

Assemble fully-uploaded partials (in order) into this final upload. Called by the concatenation extension.
Source§

async fn read_content( &self, ) -> Result<Box<dyn AsyncRead + Send + Unpin>, TusError>

Stream the completed upload bytes for HTTP GET (download) requests. Return TusError::UploadNotReadyForDownload when the upload is incomplete or not readable.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more