[−][src]Struct target_tuples::Target
The representation of a target tuple.
A Target Tuple is of the form arch-vendor-system, where system can be either os-env or simply either os or env (the latter is used in the case of a freestanding target).
There are two types of target tuple: canonical and exact. This type can be used to represent both.
The core::fmt::Display implementation will display the canonical tuple;
the function Self::get_name extracts the exact form that was parsed.
In any case, if any field, other than vendor, is unknown, or the form is not the one above,
the core::str::FromStr implementation will yield an UnknownError.
Implementations
impl Target[src]
pub fn get_name(&self) -> &str[src]
Gets the exact name of the target tuple.
pub fn get_arch_name(&self) -> &str[src]
Returns the architecture name
pub fn get_vendor_name(&self) -> &str[src]
pub fn parse(s: &str) -> Self[src]
Parses a target tuple of the form arch-vendor-system (where system is either os-env, os, or env). If a field is not known, it is left as unknown, and the original value will be available through the exact name.
Panics if s is not of the above form
pub fn get_operating_system(&self) -> OS[src]
Gets the value of the os field, or unknown if the os was omitted
pub fn get_environment(&self) -> Environment[src]
Gets the value of the env field, or unknown if the environment was omitted
pub fn from_components(
arch: Architecture,
vendor: Vendor,
os: Option<OS>,
env: Option<Environment>,
objfmt: Option<ObjectFormat>
) -> Self[src]
arch: Architecture,
vendor: Vendor,
os: Option<OS>,
env: Option<Environment>,
objfmt: Option<ObjectFormat>
) -> Self
Constructs a target tuple in canonical form from the specified components.
pub fn get_object_format(&self) -> ObjectFormat[src]
Gets the object format, either from the end of the env field, or the default for the target
pub fn get_arch(&self) -> Architecture[src]
Gets the value of the Architecture field
pub fn get_vendor(&self) -> Vendor[src]
Gets the value of the vendor field.
Trait Implementations
impl Clone for Target[src]
impl Debug for Target[src]
impl Display for Target[src]
impl FromStr for Target[src]
Auto Trait Implementations
impl RefUnwindSafe for Target[src]
impl Send for Target[src]
impl Sync for Target[src]
impl Unpin for Target[src]
impl UnwindSafe for Target[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>,