use super::super::errors::*;
use {kutil::std::*, std::str::*};
#[derive(Clone, Copy, Debug, Display)]
#[display(lowercase)]
pub enum TarCompression {
None,
Gzip,
#[strings("zstd")]
Zstandard,
}
impl FromStr for TarCompression {
type Err = UrlError;
fn from_str(representation: &str) -> Result<Self, Self::Err> {
match representation {
"gzip" => Ok(Self::Gzip),
"zstd" => Ok(Self::Zstandard),
_ => Err(UrlError::UnsupportedFormat(representation.into())),
}
}
}