Skip to main content

ConfigSetting

Enum ConfigSetting 

Source
#[non_exhaustive]
pub enum ConfigSetting {
Show 28 variants MaxFileSize, MaxTotalSize, MaxFileCount, MaxPathDepth, MaxCompressionRatio, MaxSolidCompressionRatio, MaxSolidBlockMemory, MaxTarMetadataBytes, MaxDecoderMemory, DecompressionBudget, AllowedExtension, BannedPathComponent, OutputPath, SourcePaths, StripPrefix, CreationFormat, AtomicExtraction, ZipOutputWriter, MaxBytes, ParallelDecodeMemory, ExcludePattern, ZipConsistency, PathModel, ArchiveFormat, DecodeReuse, DecodeReuseLimit, SkipKind, Durability,
}
Expand description

A configuration value or required input that was refused.

as_str is the stable snake_case identifier shared by the Python, Node and CLI front ends; label is the noun used in messages.

§Examples

use exarch_core::ConfigSetting;

assert_eq!(ConfigSetting::MaxFileSize.as_str(), "max_file_size");
assert_eq!(ConfigSetting::AllowedExtension.label(), "allowed extension");

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

MaxFileSize

SecurityConfig::max_file_size.

§

MaxTotalSize

SecurityConfig::max_total_size.

§

MaxFileCount

SecurityConfig::max_file_count.

§

MaxPathDepth

SecurityConfig::max_path_depth.

§

MaxCompressionRatio

SecurityConfig::max_compression_ratio.

§

MaxSolidCompressionRatio

SecurityConfig::max_solid_compression_ratio.

§

MaxSolidBlockMemory

SecurityConfig::max_solid_block_memory.

§

MaxTarMetadataBytes

SecurityConfig::max_tar_metadata_bytes.

§

MaxDecoderMemory

SecurityConfig::max_decoder_memory.

§

DecompressionBudget

The decompression budget of an integrity check.

§

AllowedExtension

An entry of the extension allowlist.

§

BannedPathComponent

An entry of the banned path component list.

§

OutputPath

The path of the archive to create.

§

SourcePaths

The paths to add to an archive.

§

StripPrefix

The prefix stripped from entry names.

§

CreationFormat

The archive format to create.

§

AtomicExtraction

Atomic extraction.

§

ZipOutputWriter

The writer a ZIP archive is created into.

§

MaxBytes

The byte cap of an in-memory extraction.

§

ParallelDecodeMemory

SecurityConfig::parallel_decode, the lookahead memory of parallel 7z decoding.

§

ExcludePattern

An entry of the creation exclude patterns.

§

ZipConsistency

The ZIP structure policy.

§

PathModel

The path model of a sink extraction.

§

ArchiveFormat

The archive format of an extraction or listing.

§

DecodeReuse

The decode reuse mode of an extraction.

§

DecodeReuseLimit

The byte limit of a decode reuse mode.

§

SkipKind

The kind of an entry skip.

§

Durability

The durability of a created archive file.

Implementations§

Source§

impl ConfigSetting

Source

pub const ALL: &'static [Self]

Every variant, in declaration order.

Source

pub const NAMES: &'static [&'static str]

The string form of every variant, in declaration order.

Source

pub const fn as_str(self) -> &'static str

Returns the stable string form shared by Display and all language bindings.

Source§

impl ConfigSetting

Source

pub fn describe(self, problem: &ConfigProblem) -> String

The message of a refused configuration: "{label} {problem}", or "no {label} provided" for a list that came up empty.

§Examples
use exarch_core::ConfigProblem;
use exarch_core::ConfigSetting;

let text = ConfigSetting::MaxFileSize.describe(&ConfigProblem::Zero);
assert_eq!(text, "max_file_size must not be zero");
Source

pub const fn label(self) -> &'static str

The noun used for this setting in messages.

Trait Implementations§

Source§

impl Clone for ConfigSetting

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl ClosedEnum for ConfigSetting

Source§

const ALL: &'static [Self] = Self::ALL

Every variant, in declaration order.
Source§

const NAMES: &'static [&'static str] = Self::NAMES

The string form of every variant, in declaration order.
Source§

fn as_str(self) -> &'static str

The stable string form of this variant.
Source§

fn parse_for(setting: ConfigSetting, value: &str) -> Result<Self>

Parses the string form of a variant. Read more
Source§

impl Copy for ConfigSetting

Source§

impl Debug for ConfigSetting

Source§

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

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

impl Display for ConfigSetting

Source§

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

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

impl Eq for ConfigSetting

Source§

impl Hash for ConfigSetting

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ConfigSetting

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ConfigSetting

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.