pub struct CapabilityMatrix {
pub host: HostInfo,
pub targets: BTreeMap<TargetTriple, TargetInfo>,
}Expand description
Capability matrix for host/target combinations.
Fields§
§host: HostInfo§targets: BTreeMap<TargetTriple, TargetInfo>Implementations§
Source§impl CapabilityMatrix
impl CapabilityMatrix
Sourcepub fn new() -> Result<Self, HostDetectError>
pub fn new() -> Result<Self, HostDetectError>
Creates a new capability matrix for the current host.
Sourcepub fn assess(&mut self, target: &TargetTriple) -> &TargetInfo
pub fn assess(&mut self, target: &TargetTriple) -> &TargetInfo
Assesses a target and adds it to the matrix.
Sourcepub fn get(&mut self, target: &TargetTriple) -> &TargetInfo
pub fn get(&mut self, target: &TargetTriple) -> &TargetInfo
Gets the assessment for a target, computing it if necessary.
Sourcepub fn all_targets(&self) -> &BTreeMap<TargetTriple, TargetInfo>
pub fn all_targets(&self) -> &BTreeMap<TargetTriple, TargetInfo>
Returns all assessed targets.
Sourcepub fn is_native(&self, target: &TargetTriple) -> bool
pub fn is_native(&self, target: &TargetTriple) -> bool
Checks if a target can be built natively.
Sourcepub fn requires_cross(&self, target: &TargetTriple) -> bool
pub fn requires_cross(&self, target: &TargetTriple) -> bool
Checks if cross-compilation is required.
Sourcepub fn toolchain_hint(&mut self, target: &TargetTriple) -> ToolchainHint
pub fn toolchain_hint(&mut self, target: &TargetTriple) -> ToolchainHint
Gets the recommended toolchain provider for a target.
Sourcepub fn sysroot_hint(&mut self, target: &TargetTriple) -> SysrootHint
pub fn sysroot_hint(&mut self, target: &TargetTriple) -> SysrootHint
Gets the recommended sysroot provider for a target.
Sourcepub fn linker_hint(&mut self, target: &TargetTriple) -> LinkerHint
pub fn linker_hint(&mut self, target: &TargetTriple) -> LinkerHint
Gets the recommended linker for a target.
Trait Implementations§
Source§impl Clone for CapabilityMatrix
impl Clone for CapabilityMatrix
Source§impl Debug for CapabilityMatrix
impl Debug for CapabilityMatrix
Auto Trait Implementations§
impl Freeze for CapabilityMatrix
impl RefUnwindSafe for CapabilityMatrix
impl Send for CapabilityMatrix
impl Sync for CapabilityMatrix
impl Unpin for CapabilityMatrix
impl UnsafeUnpin for CapabilityMatrix
impl UnwindSafe for CapabilityMatrix
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more