Enum cargo_platform::Platform
source · pub enum Platform {
Name(String),
Cfg(CfgExpr),
}
Expand description
Platform definition.
Variants§
Name(String)
A named platform, like x86_64-apple-darwin
.
Cfg(CfgExpr)
A cfg expression, like cfg(windows)
.
Implementations§
source§impl Platform
impl Platform
sourcepub fn matches(&self, name: &str, cfg: &[Cfg]) -> bool
pub fn matches(&self, name: &str, cfg: &[Cfg]) -> bool
Returns whether the Platform matches the given target and cfg.
The named target and cfg values should be obtained from rustc
.
pub(crate) fn validate_named_platform(name: &str) -> Result<(), ParseError>
pub fn check_cfg_attributes(&self, warnings: &mut Vec<String>)
Trait Implementations§
source§impl<'de> Deserialize<'de> for Platform
impl<'de> Deserialize<'de> for Platform
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 Ord for Platform
impl Ord for Platform
source§impl PartialEq<Platform> for Platform
impl PartialEq<Platform> for Platform
source§impl PartialOrd<Platform> for Platform
impl PartialOrd<Platform> for Platform
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Platform
impl StructuralEq for Platform
impl StructuralPartialEq for Platform
Auto Trait Implementations§
impl RefUnwindSafe for Platform
impl Send for Platform
impl Sync for Platform
impl Unpin for Platform
impl UnwindSafe for Platform
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
impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 56 bytes
Size for each variant:
Name
: 32 bytesCfg
: 56 bytes