#[non_exhaustive]pub struct SourceDefinition {
pub emoji: String,
pub install: String,
pub check: String,
pub prefix: Option<String>,
pub overrides: Option<HashMap<String, PlatformOverride>>,
}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.emoji: StringEmoji icon to represent this source
install: StringCommand template to install packages
check: StringCommand to list installed packages from this source
prefix: Option<String>String to prepend to package names (optional)
overrides: Option<HashMap<String, PlatformOverride>>Platform-specific command overrides
Implementations§
Source§impl SourceDefinition
impl SourceDefinition
Sourcepub fn new(
emoji: String,
install: String,
check: String,
prefix: Option<String>,
overrides: Option<HashMap<String, PlatformOverride>>,
) -> Self
pub fn new( emoji: String, install: String, check: String, prefix: Option<String>, overrides: Option<HashMap<String, PlatformOverride>>, ) -> Self
Create a new SourceDefinition with the given fields.
Sourcepub fn get_install_command(&self, platform: &Platform) -> &str
pub fn get_install_command(&self, platform: &Platform) -> &str
Get the appropriate command for the current platform
Sourcepub fn get_check_command(&self, platform: &Platform) -> &str
pub fn get_check_command(&self, platform: &Platform) -> &str
Get the appropriate check command for the current platform
Trait Implementations§
Source§impl Clone for SourceDefinition
impl Clone for SourceDefinition
Source§impl Debug for SourceDefinition
impl Debug for SourceDefinition
Source§impl<'de> Deserialize<'de> for SourceDefinition
impl<'de> Deserialize<'de> for SourceDefinition
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 SourceDefinition
impl RefUnwindSafe for SourceDefinition
impl Send for SourceDefinition
impl Sync for SourceDefinition
impl Unpin for SourceDefinition
impl UnsafeUnpin for SourceDefinition
impl UnwindSafe for SourceDefinition
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