pub enum PkgFmt {
Tar,
Tbz2,
Tgz,
Txz,
Tzstd,
Zip,
Bin,
}
Expand description
Binary format enumeration
Variants§
Tar
Download format is TAR (uncompressed)
Tbz2
Download format is TAR + Bzip2
Tgz
Download format is TGZ (TAR + GZip)
Txz
Download format is TAR + XZ
Tzstd
Download format is TAR + Zstd
Zip
Download format is Zip
Bin
Download format is raw / binary
Implementations§
Source§impl PkgFmt
impl PkgFmt
Sourcepub fn decompose(self) -> PkgFmtDecomposed
pub fn decompose(self) -> PkgFmtDecomposed
If self is one of the tar based formats, return Some.
Sourcepub fn extensions(self, is_windows: bool) -> &'static [&'static str]
pub fn extensions(self, is_windows: bool) -> &'static [&'static str]
List of possible file extensions for the format
(with prefix .
).
is_windows
- if true andself == PkgFmt::Bin
, then it will return.exe
in additional to other bin extension names.
Sourcepub fn guess_pkg_format(pkg_url: &str) -> Option<PkgFmt>
pub fn guess_pkg_format(pkg_url: &str) -> Option<PkgFmt>
Given the pkg-url template, guess the possible pkg-fmt.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PkgFmt
impl<'de> Deserialize<'de> for PkgFmt
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PkgFmt, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PkgFmt, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<TarBasedFmt> for PkgFmt
impl From<TarBasedFmt> for PkgFmt
Source§fn from(fmt: TarBasedFmt) -> PkgFmt
fn from(fmt: TarBasedFmt) -> PkgFmt
Converts to this type from the input type.
Source§impl IntoEnumIterator for PkgFmt
impl IntoEnumIterator for PkgFmt
type Iterator = PkgFmtIter
fn iter() -> PkgFmtIter
Source§impl Serialize for PkgFmt
impl Serialize for PkgFmt
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for PkgFmt
impl Eq for PkgFmt
impl StructuralPartialEq for PkgFmt
Auto Trait Implementations§
impl Freeze for PkgFmt
impl RefUnwindSafe for PkgFmt
impl Send for PkgFmt
impl Sync for PkgFmt
impl Unpin for PkgFmt
impl UnwindSafe for PkgFmt
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string()
Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString
. Read more