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 PartialOrd for Platform
impl PartialOrd for Platform
impl Eq for Platform
impl StructuralPartialEq for Platform
Auto Trait Implementations§
impl Freeze for Platform
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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: 48 bytes
Size for each variant:
Name
: 32 bytesCfg
: 48 bytes