Struct rustic_backend::rclone::RcloneBackend
source · pub struct RcloneBackend { /* private fields */ }
Expand description
RcloneBackend
is a backend that uses rclone to access a remote backend.
Implementations§
source§impl RcloneBackend
impl RcloneBackend
sourcepub fn new(
url: impl AsRef<str>,
options: HashMap<String, String>,
) -> Result<Self>
pub fn new( url: impl AsRef<str>, options: HashMap<String, String>, ) -> Result<Self>
Create a new RcloneBackend
from a given url.
§Arguments
url
- The url to create theRcloneBackend
from.
§Errors
RcloneErrorKind::FromIoError
- If the rclone version could not be determined.RcloneErrorKind::NoStdOutForRclone
- If the rclone version could not be determined.RcloneErrorKind::RCloneExitWithBadStatus
- If rclone exited with a bad status.RcloneErrorKind::UrlNotStartingWithHttp
- If the URL does not start withhttp
.
§Returns
The created RcloneBackend
.
§Panics
If the rclone command is not found.
Trait Implementations§
source§impl Debug for RcloneBackend
impl Debug for RcloneBackend
source§impl ReadBackend for RcloneBackend
impl ReadBackend for RcloneBackend
source§fn list_with_size(&self, tpe: FileType) -> Result<Vec<(Id, u32)>>
fn list_with_size(&self, tpe: FileType) -> Result<Vec<(Id, u32)>>
Returns the size of the given file.
§Arguments
tpe
- The type of the file.
If the size could not be determined.
source§fn read_partial(
&self,
tpe: FileType,
id: &Id,
cacheable: bool,
offset: u32,
length: u32,
) -> Result<Bytes>
fn read_partial( &self, tpe: FileType, id: &Id, cacheable: bool, offset: u32, length: u32, ) -> Result<Bytes>
source§fn list(&self, tpe: FileType) -> Result<Vec<Id>, Error>
fn list(&self, tpe: FileType) -> Result<Vec<Id>, Error>
Lists all files of the given type. Read more
source§fn needs_warm_up(&self) -> bool
fn needs_warm_up(&self) -> bool
Specify if the backend needs a warming-up of files before accessing them.
source§impl WriteBackend for RcloneBackend
impl WriteBackend for RcloneBackend
Auto Trait Implementations§
impl Freeze for RcloneBackend
impl !RefUnwindSafe for RcloneBackend
impl Send for RcloneBackend
impl Sync for RcloneBackend
impl Unpin for RcloneBackend
impl !UnwindSafe for RcloneBackend
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 more