pub enum MetadataFileName {
BuildInfo,
Mtree,
PackageInfo,
}
Expand description
The name of a required metadata file in an alpm-package.
Variants§
Trait Implementations§
Source§impl AsRef<str> for MetadataFileName
impl AsRef<str> for MetadataFileName
Source§impl Clone for MetadataFileName
impl Clone for MetadataFileName
Source§fn clone(&self) -> MetadataFileName
fn clone(&self) -> MetadataFileName
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 MetadataFileName
impl Debug for MetadataFileName
Source§impl<'de> Deserialize<'de> for MetadataFileName
impl<'de> Deserialize<'de> for MetadataFileName
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for MetadataFileName
impl Display for MetadataFileName
Source§impl<'_derivative_strum> From<&'_derivative_strum MetadataFileName> for &'static str
impl<'_derivative_strum> From<&'_derivative_strum MetadataFileName> for &'static str
Source§fn from(x: &'_derivative_strum MetadataFileName) -> &'static str
fn from(x: &'_derivative_strum MetadataFileName) -> &'static str
Converts to this type from the input type.
Source§impl From<MetadataFileName> for &'static str
impl From<MetadataFileName> for &'static str
Source§fn from(x: MetadataFileName) -> &'static str
fn from(x: MetadataFileName) -> &'static str
Converts to this type from the input type.
Source§impl From<MetadataFileName> for String
impl From<MetadataFileName> for String
Source§fn from(value: MetadataFileName) -> Self
fn from(value: MetadataFileName) -> Self
Creates a String
from MetadataFileName
.
§Examples
use alpm_types::MetadataFileName;
assert_eq!(MetadataFileName::BuildInfo.to_string(), ".BUILDINFO");
assert_eq!(MetadataFileName::Mtree.to_string(), ".MTREE");
assert_eq!(MetadataFileName::PackageInfo.to_string(), ".PKGINFO");
Source§impl FromStr for MetadataFileName
impl FromStr for MetadataFileName
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Creates a MetadataFileName
from string slice.
§Errors
Returns an error if s
does not equal the string representation of a MetadataFileName
variant.
§Examples
use std::str::FromStr;
use alpm_types::MetadataFileName;
assert_eq!(
MetadataFileName::BuildInfo,
MetadataFileName::from_str(".BUILDINFO")?
);
assert_eq!(
MetadataFileName::Mtree,
MetadataFileName::from_str(".MTREE")?
);
assert_eq!(
MetadataFileName::PackageInfo,
MetadataFileName::from_str(".PKGINFO")?
);
assert!(MetadataFileName::from_str(".WRONG").is_err());
Source§impl PartialEq for MetadataFileName
impl PartialEq for MetadataFileName
Source§impl Serialize for MetadataFileName
impl Serialize for MetadataFileName
Source§impl TryFrom<String> for MetadataFileName
impl TryFrom<String> for MetadataFileName
Source§fn try_from(value: String) -> Result<Self, Self::Error>
fn try_from(value: String) -> Result<Self, Self::Error>
Creates a MetadataFileName
from String
.
§Errors
Returns an error if s
does not equal the string representation of a MetadataFileName
variant.
§Examples
use alpm_types::MetadataFileName;
assert_eq!(
MetadataFileName::BuildInfo,
MetadataFileName::try_from(".BUILDINFO".to_string())?
);
assert_eq!(
MetadataFileName::Mtree,
MetadataFileName::try_from(".MTREE".to_string())?
);
assert_eq!(
MetadataFileName::PackageInfo,
MetadataFileName::try_from(".PKGINFO".to_string())?
);
assert!(MetadataFileName::try_from(".WRONG".to_string()).is_err());
impl Copy for MetadataFileName
impl Eq for MetadataFileName
impl StructuralPartialEq for MetadataFileName
Auto Trait Implementations§
impl Freeze for MetadataFileName
impl RefUnwindSafe for MetadataFileName
impl Send for MetadataFileName
impl Sync for MetadataFileName
impl Unpin for MetadataFileName
impl UnwindSafe for MetadataFileName
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