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§
fn caps(&self) -> Caps
Sourcefn write(
&mut self,
local: &Path,
remote: &str,
exclusive: bool,
) -> Result<(), StoreError>
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).
Sourcefn rename(
&mut self,
from: &str,
to: &str,
replace: bool,
) -> Result<(), StoreError>
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).
fn exists(&mut self, remote: &str) -> Result<bool, StoreError>
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".