pub enum Architecture {
Any,
Some(SystemArchitecture),
}Expand description
A valid alpm-architecture, either “any” or a specific SystemArchitecture.
Members of the Architecture enum can be created from &str.
§Examples
use std::str::FromStr;
use alpm_types::{Architecture, SystemArchitecture, UnknownArchitecture};
// create Architecture from str
assert_eq!(
Architecture::from_str("aarch64"),
Ok(SystemArchitecture::Aarch64.into())
);
assert_eq!(Architecture::from_str("any"), Ok(Architecture::Any));
// format as String
assert_eq!("any", format!("{}", Architecture::Any));
assert_eq!(
"x86_64",
format!("{}", Architecture::Some(SystemArchitecture::X86_64))
);
assert_eq!(
"custom_arch",
format!("{}", Architecture::from_str("custom_arch")?)
);Variants§
Trait Implementations§
Source§impl AlpmParser for Architecture
impl AlpmParser for Architecture
Source§fn parser(input: &mut &str) -> ModalResult<Architecture>
fn parser(input: &mut &str) -> ModalResult<Architecture>
Recognizes an Architecture in an input string.
§Errors
Returns an error if input does not contain a valid Architecture.
Source§impl Clone for Architecture
impl Clone for Architecture
Source§fn clone(&self) -> Architecture
fn clone(&self) -> Architecture
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Architecture
impl Debug for Architecture
Source§impl<'de> Deserialize<'de> for Architecture
impl<'de> Deserialize<'de> for Architecture
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>,
Source§impl Display for Architecture
impl Display for Architecture
impl Eq for Architecture
Source§impl From<Architecture> for Architectures
impl From<Architecture> for Architectures
Source§fn from(value: Architecture) -> Self
fn from(value: Architecture) -> Self
Converts a single Architecture into an Architectures.
Source§impl From<SystemArchitecture> for Architecture
impl From<SystemArchitecture> for Architecture
Source§fn from(value: SystemArchitecture) -> Self
fn from(value: SystemArchitecture) -> Self
Converts a SystemArchitecture into an Architecture.
Source§impl From<UnknownArchitecture> for Architecture
impl From<UnknownArchitecture> for Architecture
Source§fn from(value: UnknownArchitecture) -> Self
fn from(value: UnknownArchitecture) -> Self
Converts an UnknownArchitecture into an Architecture.
Source§impl FromStr for Architecture
impl FromStr for Architecture
Source§fn from_str(s: &str) -> Result<Architecture, Self::Err>
fn from_str(s: &str) -> Result<Architecture, Self::Err>
Creates an Architecture from a string slice.
Delegates to Architecture::parser.
§Errors
Returns an error if Architecture::parser fails.
Source§impl Hash for Architecture
impl Hash for Architecture
Source§impl Ord for Architecture
impl Ord for Architecture
Source§fn cmp(&self, other: &Architecture) -> Ordering
fn cmp(&self, other: &Architecture) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for Architecture
impl PartialEq for Architecture
Source§fn eq(&self, other: &Architecture) -> bool
fn eq(&self, other: &Architecture) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for Architecture
impl PartialOrd for Architecture
Source§impl Serialize for Architecture
impl Serialize for Architecture
impl StructuralPartialEq for Architecture
Auto Trait Implementations§
impl Freeze for Architecture
impl RefUnwindSafe for Architecture
impl Send for Architecture
impl Sync for Architecture
impl Unpin for Architecture
impl UnsafeUnpin for Architecture
impl UnwindSafe for Architecture
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<U> ParserUntil for Uwhere
U: AlpmParser,
impl<U> ParserUntil for Uwhere
U: AlpmParser,
Source§fn parser_until<'a, P>(
delimiter: P,
) -> impl Parser<&'a str, U, ErrMode<ContextError>>
fn parser_until<'a, P>( delimiter: P, ) -> impl Parser<&'a str, U, ErrMode<ContextError>>
Returns a [Parser] that parses Self until the given delimiter parser
matches.
§Note
Does not consume the delimiter.
Source§fn parser_until_eof(input: &mut &str) -> Result<Self, ErrMode<ContextError>>
fn parser_until_eof(input: &mut &str) -> Result<Self, ErrMode<ContextError>>
Source§impl<U> ParserUntilInclusive for Uwhere
U: ParserUntil,
impl<U> ParserUntilInclusive for Uwhere
U: ParserUntil,
Source§fn parser_until_inclusive<'a, P>(
delimiter: P,
) -> impl Parser<&'a str, U, ErrMode<ContextError>>
fn parser_until_inclusive<'a, P>( delimiter: P, ) -> impl Parser<&'a str, U, ErrMode<ContextError>>
Returns a [Parser] that parses the whole input and consumes the given delimiter parser.
Delegates to ParserUntil::parser_until and consumes the delimiter.