Skip to main content

DavLockSystem

Trait DavLockSystem 

Source
pub trait DavLockSystem: Send + Sync {
    // Required methods
    fn lock(
        &self,
        path: &DavPath,
        principal: Option<&str>,
        owner: Option<&DavXmlElement>,
        timeout: Option<Duration>,
        shared: bool,
        deep: bool,
    ) -> LsFuture<'_, Result<DavLock, DavLockError>>;
    fn unlock(
        &self,
        path: &DavPath,
        token: &str,
    ) -> LsFuture<'_, Result<(), DavLockError>>;
    fn refresh(
        &self,
        path: &DavPath,
        token: &str,
        timeout: Option<Duration>,
    ) -> LsFuture<'_, Result<DavLock, DavLockError>>;
    fn check(
        &self,
        path: &DavPath,
        principal: Option<&str>,
        ignore_principal: bool,
        deep: bool,
        submitted_tokens: &[String],
    ) -> LsFuture<'_, Result<(), DavLock>>;
    fn discover(&self, path: &DavPath) -> LsFuture<'_, Vec<DavLock>>;
    fn conflicting_locks(
        &self,
        path: &DavPath,
        deep: bool,
    ) -> LsFuture<'_, Vec<DavLock>>;
    fn delete(&self, path: &DavPath) -> LsFuture<'_, Result<(), DavLockError>>;

    // Provided methods
    fn prepare_lock(
        &self,
        _path: &DavPath,
    ) -> LsFuture<'_, Result<(), DavLockPreflightError>> { ... }
    fn discover_many<'a>(
        &'a self,
        paths: &'a [DavPath],
    ) -> LsFuture<'a, HashMap<DavPath, Vec<DavLock>>> { ... }
}
Expand description

Canonical lock persistence and conflict backend port.

Required Methods§

Source

fn lock( &self, path: &DavPath, principal: Option<&str>, owner: Option<&DavXmlElement>, timeout: Option<Duration>, shared: bool, deep: bool, ) -> LsFuture<'_, Result<DavLock, DavLockError>>

Source

fn unlock( &self, path: &DavPath, token: &str, ) -> LsFuture<'_, Result<(), DavLockError>>

Source

fn refresh( &self, path: &DavPath, token: &str, timeout: Option<Duration>, ) -> LsFuture<'_, Result<DavLock, DavLockError>>

Source

fn check( &self, path: &DavPath, principal: Option<&str>, ignore_principal: bool, deep: bool, submitted_tokens: &[String], ) -> LsFuture<'_, Result<(), DavLock>>

Source

fn discover(&self, path: &DavPath) -> LsFuture<'_, Vec<DavLock>>

Source

fn conflicting_locks( &self, path: &DavPath, deep: bool, ) -> LsFuture<'_, Vec<DavLock>>

Source

fn delete(&self, path: &DavPath) -> LsFuture<'_, Result<(), DavLockError>>

Provided Methods§

Source

fn prepare_lock( &self, _path: &DavPath, ) -> LsFuture<'_, Result<(), DavLockPreflightError>>

Source

fn discover_many<'a>( &'a self, paths: &'a [DavPath], ) -> LsFuture<'a, HashMap<DavPath, Vec<DavLock>>>

Implementors§