pub enum StorageNewSubCommand {
    Local {
        path: PathBuf,
        name: String,
    },
    Generic {
        name: String,
        init_command: String,
        list_command: String,
        download_command: String,
        upload_command: String,
        delete_command: String,
        max_processes: usize,
        url: Option<String>,
        storage_dir: Option<String>,
    },
    Rsync {
        name: String,
        host: String,
        port: Option<usize>,
        user: Option<String>,
        storage_dir: String,
    },
    S3 {
        name: String,
        storage_prefix: String,
        bucket_name: String,
        region: String,
    },
    Minio {
        name: String,
        endpoint: String,
        bucket_name: String,
        region: String,
        storage_prefix: String,
    },
    DigitalOcean {
        name: String,
        bucket_name: String,
        region: String,
        storage_prefix: String,
    },
    R2 {
        name: String,
        account_id: String,
        bucket_name: String,
        storage_prefix: String,
    },
    Gcs {
        name: String,
        bucket_name: String,
        region: String,
        storage_prefix: String,
    },
    Wasabi {
        name: String,
        bucket_name: String,
        endpoint: String,
        storage_prefix: String,
    },
}
Expand description

Add a new storage

Variants§

§

Local

Fields

§path: PathBuf

Directory (outside the repository) to be set as a storage

§name: String

Name of the storage.

Recommended to keep this name unique to refer easily.

Add a new local storage

A local storage is a directory accessible from the local file system. Xvc will use common file operations for this directory without accessing the network.

§

Generic

Fields

§name: String

Name of the storage.

Recommended to keep this name unique to refer easily.

§init_command: String

Command to initialize the storage. This command is run once after defining the storage.

You can use {URL} and {STORAGE_DIR} as shortcuts.

§list_command: String

Command to list the files in storage

You can use {URL} and {STORAGE_DIR} placeholders and define values for these with –url and –storage_dir options.

§download_command: String

Command to download a file from storage.

You can use {URL} and {STORAGE_DIR} placeholders and define values for these with –url and –storage_dir options.

§upload_command: String

Command to upload a file to storage.

You can use {URL} and {STORAGE_DIR} placeholders and define values for these with –url and –storage_dir options.

§delete_command: String

The delete command to remove a file from storage You can use {URL} and {STORAGE_DIR} placeholders and define values for these with –url and –storage_dir options.

§max_processes: usize

Number of maximum processes to run simultaneously

§url: Option<String>

You can set a string to replace {URL} placeholder in commands

§storage_dir: Option<String>

You can set a string to replace {STORAGE_DIR} placeholder in commands

Add a new generic storage.

⚠️ Please note that this is an advanced method to configure storages. You may damage your repository and local and remote files with incorrect configurations.

Please see https://docs.xvc.dev/ref/xvc-storage-new-generic.html for examples and make necessary backups.

§

Rsync

Fields

§name: String

Name of the storage.

Recommended to keep this name unique to refer easily.

§host: String

Hostname for the connection in the form host.example.com (without @, : or protocol)

§port: Option<usize>

Port number for the connection in the form 22. Doesn’t add port number to connection string if not given.

§user: Option<String>

User name for the connection, the part before @ in user@example.com (without @, hostname). User name isn’t included in connection strings if not given.

§storage_dir: String

storage directory in the host to store the files.

Add a new rsync storages

Uses rsync in separate processes to communicate. This can be used when you already have an SSH/Rsync connection. It doesn’t prompt for any passwords. The connection must be set up with ssh keys beforehand.

§

S3

Fields

§name: String

Name of the storage

This must be unique among all storages of the project

§storage_prefix: String

You can set a directory in the bucket with this prefix

§bucket_name: String

S3 bucket name

§region: String

AWS region

Add a new S3 storage

Reads credentials from AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables. Alternatively you can use XVC_STORAGE_ACCESS_KEY_ID_<storage_name> and XVC_STORAGE_SECRET_ACCESS_KEY_<storage_name> environment variables if you have multiple storages of this type.

§

Minio

Fields

§name: String

Name of the storage

This must be unique among all storages of the project

§endpoint: String

Minio server url in the form https://myserver.example.com:9090

§bucket_name: String

Bucket name

§region: String

Region of the server

§storage_prefix: String

You can set a directory in the bucket with this prefix

Add a new Minio storage

Reads credentials from MINIO_ACCESS_KEY and MINIO_SECRET_ACCESS_KEY environment variables. Alternatively you can use XVC_STORAGE_ACCESS_KEY_ID_<storage_name> and XVC_STORAGE_SECRET_ACCESS_KEY_<storage_name> environment variables if you have multiple storages of this type.

§

DigitalOcean

Fields

§name: String

Name of the storage

This must be unique among all storages of the project

§bucket_name: String

Bucket name

§region: String

Region of the server

§storage_prefix: String

You can set a directory in the bucket with this prefix

Add a new Digital Ocean storage

Reads credentials from DIGITAL_OCEAN_ACCESS_KEY_ID and DIGITAL_OCEAN_SECRET_ACCESS_KEY environment variables. Alternatively you can use XVC_STORAGE_ACCESS_KEY_ID_<storage_name> and XVC_STORAGE_SECRET_ACCESS_KEY_<storage_name> environment variables if you have multiple storages of this type.

§

R2

Fields

§name: String

Name of the storage

This must be unique among all storages of the project

§account_id: String

R2 account ID

§bucket_name: String

Bucket name

§storage_prefix: String

You can set a directory in the bucket with this prefix

Add a new R2 storage

Reads credentials from R2_ACCESS_KEY_ID and R2_SECRET_ACCESS_KEY environment variables. Alternatively you can use XVC_STORAGE_ACCESS_KEY_ID_<storage_name> and XVC_STORAGE_SECRET_ACCESS_KEY_<storage_name> environment variables if you have multiple storages of this type.

§

Gcs

Fields

§name: String

Name of the storage

This must be unique among all storages of the project

§bucket_name: String

Bucket name

§region: String

Region of the server, e.g., europe-west3

§storage_prefix: String

You can set a directory in the bucket with this prefix

Add a new Google Cloud Storage storage

Reads credentials from GCS_ACCESS_KEY_ID and GCS_SECRET_ACCESS_KEY environment variables. Alternatively you can use XVC_STORAGE_ACCESS_KEY_ID_<storage_name> and XVC_STORAGE_SECRET_ACCESS_KEY_<storage_name> environment variables if you have multiple storages of this type.

§

Wasabi

Fields

§name: String

Name of the storage

This must be unique among all storages of the project

§bucket_name: String

Bucket name

§endpoint: String

Endpoint for the server, complete with the region if there is

e.g. for eu-central-1 region, use s3.eu-central-1.wasabisys.com as the endpoint.

§storage_prefix: String

You can set a directory in the bucket with this prefix

Add a new Wasabi storage

Reads credentials from WASABI_ACCESS_KEY_ID and WASABI_SECRET_ACCESS_KEY environment variables. Alternatively you can use XVC_STORAGE_ACCESS_KEY_ID_<storage_name> and XVC_STORAGE_SECRET_ACCESS_KEY_<storage_name> environment variables if you have multiple storages of this type.

Trait Implementations§

source§

impl Clone for StorageNewSubCommand

source§

fn clone(&self) -> StorageNewSubCommand

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for StorageNewSubCommand

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl FromArgMatches for StorageNewSubCommand

source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches ) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches ) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches ) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

impl Subcommand for StorageNewSubCommand

source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate Self. Read more
source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to [Command] so it can update self. Read more
source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more