Skip to main content

Store

Trait Store 

Source
pub trait Store {
    // Required methods
    fn caps(&self) -> Caps;
    fn write(
        &mut self,
        local: &Path,
        remote: &str,
        exclusive: bool,
    ) -> Result<(), StoreError>;
    fn rename(
        &mut self,
        from: &str,
        to: &str,
        replace: bool,
    ) -> Result<(), StoreError>;
    fn exists(&mut self, remote: &str) -> Result<bool, StoreError>;
    fn delete(&mut self, remote: &str) -> Result<(), StoreError>;

    // Provided method
    fn reset(&mut self) { ... }
}
Expand description

A destination’s primitives. Paths are the destination’s own (outbound/report.xlsx).

Required Methods§

Source

fn caps(&self) -> Caps

Source

fn write( &mut self, local: &Path, remote: &str, exclusive: bool, ) -> Result<(), StoreError>

Write local to remote, creating its folders. With exclusive, fail with StoreError::Exists if something is there (only asked when caps().create_exclusive).

Source

fn rename( &mut self, from: &str, to: &str, replace: bool, ) -> Result<(), StoreError>

Rename from to to, creating to’s folders. Without replace, fail with StoreError::Exists if something is there (only asked when caps().rename_no_replace).

Source

fn exists(&mut self, remote: &str) -> Result<bool, StoreError>

Source

fn delete(&mut self, remote: &str) -> Result<(), StoreError>

Remove remote; a missing file isn’t an error.

Provided Methods§

Source

fn reset(&mut self)

Called before trying again after a temporary error: drop a broken connection, so the next call makes a new one.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§