Skip to main content

SendLocker

Trait SendLocker 

Source
pub trait SendLocker: Send {
    type LockType: SendLock;

    // Required method
    fn acquire(
        &self,
        id: &UploadId,
    ) -> impl Future<Output = Result<Self::LockType, TusError>> + Send;
}
Expand description

Concurrency guard — one exclusive lock per upload ID.

The Send-safe variant SendLocker is generated by trait_variant.

Required Associated Types§

Required Methods§

Source

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

Acquire an exclusive lock for the given upload ID. Should block (respecting a timeout) rather than fail immediately.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§