#[non_exhaustive]pub struct ComplexPackageDefinition {
pub description: Option<String>,
pub sources: Option<Vec<String>>,
pub platforms: Option<Vec<String>>,
pub aliases: Option<Vec<String>>,
pub source_configs: HashMap<String, SourceSpecificConfig>,
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.description: Option<String>Short description of the package
sources: Option<Vec<String>>List of sources where package is available with same name as key
platforms: Option<Vec<String>>Platforms where this package is available
aliases: Option<Vec<String>>Alternative names for search and discovery
source_configs: HashMap<String, SourceSpecificConfig>Source-specific configurations (flatten other fields)
Implementations§
Source§impl ComplexPackageDefinition
impl ComplexPackageDefinition
Sourcepub fn with_sources(sources: Vec<String>) -> Self
pub fn with_sources(sources: Vec<String>) -> Self
Create a new ComplexPackageDefinition with the given sources
Sourcepub fn set_platforms(&mut self, platforms: Vec<String>)
pub fn set_platforms(&mut self, platforms: Vec<String>)
Set the platforms for this package definition
Sourcepub fn set_aliases(&mut self, aliases: Vec<String>)
pub fn set_aliases(&mut self, aliases: Vec<String>)
Set the aliases for this package definition
Sourcepub fn set_description(&mut self, description: String)
pub fn set_description(&mut self, description: String)
Set the description for this package definition
Sourcepub fn get_sources(&self) -> Vec<&str>
pub fn get_sources(&self) -> Vec<&str>
Get all sources where this package is available
Sourcepub fn get_source_config(&self, source: &str) -> Option<&SourceSpecificConfig>
pub fn get_source_config(&self, source: &str) -> Option<&SourceSpecificConfig>
Get source-specific configuration for a source
Sourcepub fn is_available_in(&self, source: &str) -> bool
pub fn is_available_in(&self, source: &str) -> bool
Check if package is available in a specific source
Trait Implementations§
Source§impl Clone for ComplexPackageDefinition
impl Clone for ComplexPackageDefinition
Source§fn clone(&self) -> ComplexPackageDefinition
fn clone(&self) -> ComplexPackageDefinition
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 ComplexPackageDefinition
impl Debug for ComplexPackageDefinition
Source§impl Default for ComplexPackageDefinition
impl Default for ComplexPackageDefinition
Source§fn default() -> ComplexPackageDefinition
fn default() -> ComplexPackageDefinition
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ComplexPackageDefinitionwhere
ComplexPackageDefinition: Default,
impl<'de> Deserialize<'de> for ComplexPackageDefinitionwhere
ComplexPackageDefinition: Default,
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 ComplexPackageDefinition
impl RefUnwindSafe for ComplexPackageDefinition
impl Send for ComplexPackageDefinition
impl Sync for ComplexPackageDefinition
impl Unpin for ComplexPackageDefinition
impl UnwindSafe for ComplexPackageDefinition
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