Skip to main content

Locker

Trait Locker 

Source
pub trait Locker {
    type LockType: SendLock;

    // Required method
    async fn acquire(&self, id: &UploadId) -> Result<Self::LockType, TusError>;
}
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

async fn acquire(&self, id: &UploadId) -> Result<Self::LockType, TusError>

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§

Source§

impl<TraitVariantBlanketType: SendLocker> Locker for TraitVariantBlanketType

Source§

type LockType = <TraitVariantBlanketType as SendLocker>::LockType