pub enum BackupBackend {
S3 {
endpoint: String,
bucket: String,
access_key_id: String,
secret_access_key: String,
prefix: Option<String>,
},
Local {
path: PathBuf,
},
}Expand description
Storage backend for the backup repository. The variants map to restic’s supported backends; each carries exactly the fields restic needs to authenticate, no more.
Variants§
S3
Any S3-compatible object store: MinIO, AWS S3, Backblaze B2 via
S3 API, Cloudflare R2, Wasabi. The endpoint is the full URL
to the API (e.g. http://127.0.0.1:9000 for a local MinIO,
https://s3.us-east-1.amazonaws.com for AWS).
Fields
Local
A local filesystem path. Primarily a testing affordance — point at a tempdir and round-trip backup/restore without spinning up MinIO. Production users should prefer the S3 variant pointed at off-machine storage; a “local” backup gives no protection from disk failure.
Implementations§
Source§impl BackupBackend
impl BackupBackend
Sourcepub fn restic_repo(&self) -> String
pub fn restic_repo(&self) -> String
The --repo argument passed to the restic binary. restic uses
a single colon-prefixed string to identify the backend (“s3:”,
“rest:”, a raw path for local). This builder centralises the
formatting so callers never hand-construct it.
Sourcepub fn env(&self) -> Vec<(&'static str, String)>
pub fn env(&self) -> Vec<(&'static str, String)>
Environment variables restic needs to authenticate to this
backend. Returned as a vec of (key, value) pairs so the
caller can decide whether to set them on a Command or via
std::env::set_var (the former is preferred — keeps the
process env clean and per-invocation).
Trait Implementations§
Source§impl Clone for BackupBackend
impl Clone for BackupBackend
Source§fn clone(&self) -> BackupBackend
fn clone(&self) -> BackupBackend
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BackupBackend
impl Debug for BackupBackend
Source§impl<'de> Deserialize<'de> for BackupBackend
impl<'de> Deserialize<'de> for BackupBackend
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for BackupBackend
Source§impl PartialEq for BackupBackend
impl PartialEq for BackupBackend
Source§fn eq(&self, other: &BackupBackend) -> bool
fn eq(&self, other: &BackupBackend) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for BackupBackend
impl Serialize for BackupBackend
impl StructuralPartialEq for BackupBackend
Auto Trait Implementations§
impl Freeze for BackupBackend
impl RefUnwindSafe for BackupBackend
impl Send for BackupBackend
impl Sync for BackupBackend
impl Unpin for BackupBackend
impl UnsafeUnpin for BackupBackend
impl UnwindSafe for BackupBackend
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.