pub enum FormatKind {
Gzip,
Zstd,
Bzip2,
Xz,
Zip,
Tar,
Unknown,
}
Expand description
Supported file/compression formats.
Variants§
Gzip
Gzip compression
Zstd
ZStandard compression
Bzip2
Bzip2 compression
Xz
XZ compression
Zip
Zip archive
Tar
Tar archive. Note: this may be compressed with any of the previous compression formats (i.e. tar.gz, tar.zst, …)
Unknown
Unknown format. This is the fallback when the format is not recognized, and the associated AnyFormat will read the data as-is.
Implementations§
Source§impl FormatKind
impl FormatKind
Sourcepub const fn is_gzip(&self) -> bool
pub const fn is_gzip(&self) -> bool
Returns true if the enum is FormatKind::Gzip otherwise false
Sourcepub const fn is_zstd(&self) -> bool
pub const fn is_zstd(&self) -> bool
Returns true if the enum is FormatKind::Zstd otherwise false
Sourcepub const fn is_bzip_2(&self) -> bool
pub const fn is_bzip_2(&self) -> bool
Returns true if the enum is FormatKind::Bzip2 otherwise false
Sourcepub const fn is_unknown(&self) -> bool
pub const fn is_unknown(&self) -> bool
Returns true if the enum is FormatKind::Unknown otherwise false
Trait Implementations§
Source§impl Clone for FormatKind
impl Clone for FormatKind
Source§fn clone(&self) -> FormatKind
fn clone(&self) -> FormatKind
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for FormatKind
impl Debug for FormatKind
Source§impl Default for FormatKind
impl Default for FormatKind
Source§fn default() -> FormatKind
fn default() -> FormatKind
Returns the “default value” for a type. Read more
Source§impl Display for FormatKind
impl Display for FormatKind
Source§impl<T> From<&AnyReader<T>> for FormatKindwhere
T: Read,
impl<T> From<&AnyReader<T>> for FormatKindwhere
T: Read,
Source§fn from(reader: &AnyReader<T>) -> FormatKind
fn from(reader: &AnyReader<T>) -> FormatKind
Convert a CompressionReader
into a FormatKind
.
Source§impl<T> From<AnyReader<T>> for FormatKindwhere
T: Read,
impl<T> From<AnyReader<T>> for FormatKindwhere
T: Read,
Source§fn from(reader: AnyReader<T>) -> FormatKind
fn from(reader: AnyReader<T>) -> FormatKind
Converts to this type from the input type.
Source§impl FromStr for FormatKind
impl FromStr for FormatKind
Source§type Err = ParseError
type Err = ParseError
The associated error which can be returned from parsing.
Source§fn from_str(s: &str) -> Result<FormatKind, <FormatKind as FromStr>::Err>
fn from_str(s: &str) -> Result<FormatKind, <FormatKind as FromStr>::Err>
Parses a string
s
to return a value of this type. Read moreSource§impl Hash for FormatKind
impl Hash for FormatKind
Source§impl PartialEq for FormatKind
impl PartialEq for FormatKind
Source§impl TryFrom<&str> for FormatKind
impl TryFrom<&str> for FormatKind
Source§type Error = ParseError
type Error = ParseError
The type returned in the event of a conversion error.
Source§fn try_from(s: &str) -> Result<FormatKind, <FormatKind as TryFrom<&str>>::Error>
fn try_from(s: &str) -> Result<FormatKind, <FormatKind as TryFrom<&str>>::Error>
Performs the conversion.
impl Copy for FormatKind
impl Eq for FormatKind
impl StructuralPartialEq for FormatKind
Auto Trait Implementations§
impl Freeze for FormatKind
impl RefUnwindSafe for FormatKind
impl Send for FormatKind
impl Sync for FormatKind
impl Unpin for FormatKind
impl UnwindSafe for FormatKind
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
key
and return true
if they are equal.