Skip to main content

SendDataStore

Trait SendDataStore 

Source
pub trait SendDataStore: Send {
    type UploadType: SendUpload;

    // Required methods
    fn create_upload(
        &self,
        info: UploadInfo,
    ) -> impl Future<Output = Result<Self::UploadType, TusError>> + Send;
    fn get_upload(
        &self,
        id: &UploadId,
    ) -> impl Future<Output = Result<Self::UploadType, TusError>> + Send;
}
Expand description

Core storage abstraction.

Implement this trait to plug in any persistence backend (filesystem, S3, etc.). The associated UploadType must implement all upload operations; return TusError::ExtensionNotEnabled from extension methods your store doesn’t support.

Required Associated Types§

Required Methods§

Source

fn create_upload( &self, info: UploadInfo, ) -> impl Future<Output = Result<Self::UploadType, TusError>> + Send

Create a new upload slot and return a handle to it.

Source

fn get_upload( &self, id: &UploadId, ) -> impl Future<Output = Result<Self::UploadType, TusError>> + Send

Retrieve an existing upload by ID.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§