pub struct PlatformInfo {
pub variants: HashMap<String, VariantInfo>,
}Expand description
Platform-specific library information with variant support.
Each platform must have at least a release variant.
The release variant is the implicit default when no variant is specified.
Fields§
§variants: HashMap<String, VariantInfo>Available variants for this platform.
Must contain at least release (mandatory).
Implementations§
Source§impl PlatformInfo
impl PlatformInfo
Sourcepub fn new(library: String, checksum: String) -> Self
pub fn new(library: String, checksum: String) -> Self
Create new platform info with a single release variant.
Sourcepub fn release(&self) -> Option<&VariantInfo>
pub fn release(&self) -> Option<&VariantInfo>
Get the release variant (always present after validation).
Sourcepub fn variant(&self, name: &str) -> Option<&VariantInfo>
pub fn variant(&self, name: &str) -> Option<&VariantInfo>
Get a specific variant by name.
Sourcepub fn default_variant(&self) -> Option<&VariantInfo>
pub fn default_variant(&self) -> Option<&VariantInfo>
Get the default variant (release).
Sourcepub fn variant_names(&self) -> Vec<&str>
pub fn variant_names(&self) -> Vec<&str>
List all available variant names.
Sourcepub fn has_variant(&self, name: &str) -> bool
pub fn has_variant(&self, name: &str) -> bool
Check if a variant exists.
Sourcepub fn add_variant(&mut self, name: String, info: VariantInfo)
pub fn add_variant(&mut self, name: String, info: VariantInfo)
Add a variant to this platform.
Trait Implementations§
Source§impl Clone for PlatformInfo
impl Clone for PlatformInfo
Source§fn clone(&self) -> PlatformInfo
fn clone(&self) -> PlatformInfo
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PlatformInfo
impl Debug for PlatformInfo
Source§impl<'de> Deserialize<'de> for PlatformInfo
impl<'de> Deserialize<'de> for PlatformInfo
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
Auto Trait Implementations§
impl Freeze for PlatformInfo
impl RefUnwindSafe for PlatformInfo
impl Send for PlatformInfo
impl Sync for PlatformInfo
impl Unpin for PlatformInfo
impl UnwindSafe for PlatformInfo
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