#[non_exhaustive]
#[derive(
::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash,
)]
pub enum Resource {
#[allow(missing_docs)] FileSystem,
#[allow(missing_docs)] MountTarget,
Unknown(crate::primitives::UnknownVariantValue),
}
impl ::std::convert::From<&str> for Resource {
fn from(s: &str) -> Self {
match s {
"FILE_SYSTEM" => Resource::FileSystem,
"MOUNT_TARGET" => Resource::MountTarget,
other => Resource::Unknown(crate::primitives::UnknownVariantValue(other.to_owned())),
}
}
}
impl ::std::str::FromStr for Resource {
type Err = ::std::convert::Infallible;
fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
::std::result::Result::Ok(Resource::from(s))
}
}
impl Resource {
pub fn as_str(&self) -> &str {
match self {
Resource::FileSystem => "FILE_SYSTEM",
Resource::MountTarget => "MOUNT_TARGET",
Resource::Unknown(value) => value.as_str(),
}
}
pub const fn values() -> &'static [&'static str] {
&["FILE_SYSTEM", "MOUNT_TARGET"]
}
}
impl ::std::convert::AsRef<str> for Resource {
fn as_ref(&self) -> &str {
self.as_str()
}
}