Struct ArchiveArgs
pub struct ArchiveArgs {
pub local: Option<PathBuf>,
pub s3_bucket: Option<String>,
pub s3_region: Option<String>,
pub s3_endpoint: Option<String>,
pub s3_access_key_id: Option<String>,
pub s3_secret_access_key: Option<String>,
pub s3_allow_http: bool,
pub gcs_bucket: Option<String>,
pub gcs_service_account_path: Option<String>,
pub gcs_endpoint: Option<String>,
pub gcs_allow_http: bool,
pub prefix: Option<String>,
}Expand description
Where the archive is.
Exactly one backend is selected. The sub-flags of a backend are checked by
ArchiveArgs::validate, not by clap: a mutually exclusive ArgGroup
makes clap’s requires unenforceable, because clap treats a required
argument as acceptably absent when it conflicts with one that is present.
The fields are public so a test or an embedding tool can build the struct directly rather than through an argv.
Fields§
§local: Option<PathBuf>Use a local directory tree as the archive.
s3_bucket: Option<String>Use this S3 or S3-compatible bucket as the archive.
s3_region: Option<String>S3 region. Defaults to us-east-1, which MinIO and R2 accept as a
placeholder.
s3_endpoint: Option<String>S3 endpoint URL, for a non-AWS S3-compatible store.
s3_access_key_id: Option<String>S3 access key id. Without it the AWS credential chain applies.
s3_secret_access_key: Option<String>S3 secret access key. Without it the AWS credential chain applies.
s3_allow_http: boolAllow plaintext HTTP to the S3 endpoint.
gcs_bucket: Option<String>Use this Google Cloud Storage bucket as the archive.
gcs_service_account_path: Option<String>Path to a GCS service-account JSON key. Without it Workload Identity or application default credentials apply.
gcs_endpoint: Option<String>GCS API base URL, for an emulator.
gcs_allow_http: boolAllow plaintext HTTP to the GCS endpoint.
prefix: Option<String>Key prefix inside the archive, for a bucket that holds more than the tiered-storage tree. It applies to every backend.
Implementations§
§impl ArchiveArgs
impl ArchiveArgs
pub fn validate(&self) -> Result<(), ArchiveArgsError>
pub fn validate(&self) -> Result<(), ArchiveArgsError>
Reject a sub-flag whose backend was not selected.
§Errors
Returns [ArchiveArgsError::OrphanFlag] naming the first such flag and
the backend flag it needs.
pub fn to_config(&self) -> Result<ObjectStoreConfig, ArchiveArgsError>
pub fn to_config(&self) -> Result<ObjectStoreConfig, ArchiveArgsError>
Map the flags onto an object-store configuration.
The prefix is not set here. It stays with the caller’s archive handle,
so the same handle can address a key inside the archive and list the
archive root; see [normalize_prefix] and [prefixed_key].
§Errors
Returns [ArchiveArgsError::NoBackend] when no backend was selected.
pub fn normalized_prefix(&self) -> Option<String>
pub fn normalized_prefix(&self) -> Option<String>
--archive-prefix, through [normalize_prefix].
Trait Implementations§
§impl Args for ArchiveArgs
impl Args for ArchiveArgs
§fn group_id() -> Option<Id>
fn group_id() -> Option<Id>
ArgGroup::id][crate::ArgGroup::id] for this set of arguments§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command] so it can instantiate self via
[FromArgMatches::update_from_arg_matches_mut] Read more§impl Clone for ArchiveArgs
impl Clone for ArchiveArgs
§fn clone(&self) -> ArchiveArgs
fn clone(&self) -> ArchiveArgs
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ArchiveArgs
impl Debug for ArchiveArgs
§impl Default for ArchiveArgs
impl Default for ArchiveArgs
§fn default() -> ArchiveArgs
fn default() -> ArchiveArgs
impl Eq for ArchiveArgs
§impl FromArgMatches for ArchiveArgs
impl FromArgMatches for ArchiveArgs
§fn from_arg_matches(
__clap_arg_matches: &ArgMatches,
) -> Result<ArchiveArgs, Error>
fn from_arg_matches( __clap_arg_matches: &ArgMatches, ) -> Result<ArchiveArgs, Error>
§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<ArchiveArgs, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<ArchiveArgs, Error>
§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.§impl PartialEq for ArchiveArgs
impl PartialEq for ArchiveArgs
impl StructuralPartialEq for ArchiveArgs
Auto Trait Implementations§
impl Freeze for ArchiveArgs
impl RefUnwindSafe for ArchiveArgs
impl Send for ArchiveArgs
impl Sync for ArchiveArgs
impl Unpin for ArchiveArgs
impl UnsafeUnpin for ArchiveArgs
impl UnwindSafe for ArchiveArgs
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
impl<F> FnGhost for F
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute] value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi [Quirk] value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);