pub struct LocalBackend;Expand description
Local filesystem backend. Copies files between paths. This is the default backend – operates entirely on local disk.
Trait Implementations§
Source§impl AtomicRemoteBackend for LocalBackend
impl AtomicRemoteBackend for LocalBackend
Source§fn object_version(
&self,
remote_key: &str,
) -> Result<Option<BackendObjectVersion>, BackendError>
fn object_version( &self, remote_key: &str, ) -> Result<Option<BackendObjectVersion>, BackendError>
Return the current opaque version token for an object.
Ok(None) means the object does not exist.Source§fn upload_conditional(
&self,
local_path: &Path,
remote_key: &str,
condition: ConditionalPut,
) -> Result<BackendObjectVersion, BackendError>
fn upload_conditional( &self, local_path: &Path, remote_key: &str, condition: ConditionalPut, ) -> Result<BackendObjectVersion, BackendError>
Upload a local file only if the backend-side condition still
holds. Returns the new version token on success;
BackendError::PreconditionFailed on contention.Source§fn delete_conditional(
&self,
remote_key: &str,
condition: ConditionalDelete,
) -> Result<(), BackendError>
fn delete_conditional( &self, remote_key: &str, condition: ConditionalDelete, ) -> Result<(), BackendError>
Delete a remote object only if the backend-side condition
still holds.
BackendError::PreconditionFailed on contention.Source§impl RemoteBackend for LocalBackend
impl RemoteBackend for LocalBackend
Source§fn download(
&self,
remote_key: &str,
local_path: &Path,
) -> Result<bool, BackendError>
fn download( &self, remote_key: &str, local_path: &Path, ) -> Result<bool, BackendError>
Download a remote object to a local file path.
Returns
Ok(true) if downloaded, Ok(false) if remote object doesn’t exist.Source§fn upload(
&self,
local_path: &Path,
remote_key: &str,
) -> Result<(), BackendError>
fn upload( &self, local_path: &Path, remote_key: &str, ) -> Result<(), BackendError>
Upload a local file to remote storage.
Source§fn exists(&self, remote_key: &str) -> Result<bool, BackendError>
fn exists(&self, remote_key: &str) -> Result<bool, BackendError>
Check if a remote object exists.
Auto Trait Implementations§
impl Freeze for LocalBackend
impl RefUnwindSafe for LocalBackend
impl Send for LocalBackend
impl Sync for LocalBackend
impl Unpin for LocalBackend
impl UnsafeUnpin for LocalBackend
impl UnwindSafe for LocalBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request