pub struct OptionalDependency {
pub name: String,
pub version: String,
pub optional: bool,
pub description: Option<String>,
pub default_enabled: bool,
pub platforms: Vec<String>,
pub features: Vec<String>,
}Expand description
Represents an optional dependency
Fields§
§name: String§version: String§optional: bool§description: Option<String>§default_enabled: bool§platforms: Vec<String>§features: Vec<String>Implementations§
Source§impl OptionalDependency
impl OptionalDependency
pub fn new(name: &str, version: &str) -> Self
pub fn required(self) -> Self
pub fn with_description(self, desc: &str) -> Self
pub fn with_default_enabled(self) -> Self
pub fn with_platforms(self, platforms: Vec<&str>) -> Self
pub fn with_features(self, features: Vec<&str>) -> Self
pub fn is_platform_applicable(&self, current_platform: &str) -> bool
pub fn is_enabled(&self, enabled_features: &[String]) -> bool
Trait Implementations§
Source§impl Clone for OptionalDependency
impl Clone for OptionalDependency
Source§fn clone(&self) -> OptionalDependency
fn clone(&self) -> OptionalDependency
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 OptionalDependency
impl Debug for OptionalDependency
Source§impl<'de> Deserialize<'de> for OptionalDependency
impl<'de> Deserialize<'de> for OptionalDependency
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 OptionalDependency
impl RefUnwindSafe for OptionalDependency
impl Send for OptionalDependency
impl Sync for OptionalDependency
impl Unpin for OptionalDependency
impl UnsafeUnpin for OptionalDependency
impl UnwindSafe for OptionalDependency
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