Enum target_tuples::OS [−][src]
The Operating System Field of a target tuple
Variants (Non-exhaustive)
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Implementations
impl OS[src]
pub fn parse(s: &str) -> Self[src]
Parses the OS in a "lossy" manner
This is equivalent to Self::from_str, except that OS::Unknown is returned, instead of an error, on an unknown OS Field
Example
use target_tuples::OS;
let os = OS::parse("linux");
assert_eq!(os,OS::Linux);
let os2: OS = "linux".parse().unwrap();
assert_eq!(os,os2);pub fn canonical_name(&self) -> &'static str[src]
Returns the canonical name of the operating system
The canonical name, when passed into [Self::parse`] will yield an equivalent value,
Formatting an OS yields this string
Examples
use target_tuples::OS; let os = OS::PS4; assert_eq!(OS::parse(os.canonical_name()),os);
Trait Implementations
impl Clone for OS[src]
impl Copy for OS[src]
impl Debug for OS[src]
impl Display for OS[src]
impl Eq for OS[src]
impl FromStr for OS[src]
type Err = UnknownError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>[src]
impl PartialEq<OS> for OS[src]
impl StructuralEq for OS[src]
impl StructuralPartialEq for OS[src]
Auto Trait Implementations
impl RefUnwindSafe for OS[src]
impl Send for OS[src]
impl Sync for OS[src]
impl Unpin for OS[src]
impl UnwindSafe for OS[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,