[][src]Trait webdav_handler::ls::DavLockSystem

pub trait DavLockSystem: Debug + Sync + Send + BoxCloneLs {
    fn lock(
        &self,
        path: &WebPath,
        principal: Option<&str>,
        owner: Option<&Element>,
        timeout: Option<Duration>,
        shared: bool,
        deep: bool
    ) -> Result<DavLock, DavLock>;
fn unlock(&self, path: &WebPath, token: &str) -> Result<(), ()>;
fn refresh(
        &self,
        path: &WebPath,
        token: &str,
        timeout: Option<Duration>
    ) -> Result<DavLock, ()>;
fn check(
        &self,
        path: &WebPath,
        principal: Option<&str>,
        ignore_principal: bool,
        deep: bool,
        submitted_tokens: Vec<&str>
    ) -> Result<(), DavLock>;
fn discover(&self, path: &WebPath) -> Vec<DavLock>;
fn delete(&self, path: &WebPath) -> Result<(), ()>; }

The trait that defines a locksystem.

Required methods

fn lock(
    &self,
    path: &WebPath,
    principal: Option<&str>,
    owner: Option<&Element>,
    timeout: Option<Duration>,
    shared: bool,
    deep: bool
) -> Result<DavLock, DavLock>

Lock a node. Returns Ok(new_lock) if succeeded, or Err(conflicting_lock) if failed.

fn unlock(&self, path: &WebPath, token: &str) -> Result<(), ()>

Unlock a node. Returns empty Ok if succeeded, empty Err if failed (because lock doesn't exist)

fn refresh(
    &self,
    path: &WebPath,
    token: &str,
    timeout: Option<Duration>
) -> Result<DavLock, ()>

Refresh lock. Returns updated lock if succeeded.

fn check(
    &self,
    path: &WebPath,
    principal: Option<&str>,
    ignore_principal: bool,
    deep: bool,
    submitted_tokens: Vec<&str>
) -> Result<(), DavLock>

Check if node is locked and if so, if we own all the locks. If not, returns as Err one conflicting lock.

fn discover(&self, path: &WebPath) -> Vec<DavLock>

Find and return all locks that cover a given path.

fn delete(&self, path: &WebPath) -> Result<(), ()>

Delete all locks at this path and below (after MOVE or DELETE)

Loading content...

Implementors

impl DavLockSystem for FakeLs[src]

impl DavLockSystem for MemLs[src]

Loading content...