pub enum PackageRef {
ByName(PackageName),
ById(PackageId),
}Expand description
A package reference provided by callers or CLI commands.
Package references can either name a package directly or point to an
explicit catalog id via @winget/<id>, @scoop/<bucket>/<id>,
@chocolatey/<id>, or @winbrew/<id> syntax.
Variants§
ByName(PackageName)
Reference by display name or package name.
ById(PackageId)
Reference by explicit package id.
Implementations§
Source§impl PackageRef
impl PackageRef
Sourcepub fn parse(input: &str) -> Result<Self, ModelError>
pub fn parse(input: &str) -> Result<Self, ModelError>
Parse a package reference from name or an explicit catalog id.
Trait Implementations§
Source§impl Clone for PackageRef
impl Clone for PackageRef
Source§fn clone(&self) -> PackageRef
fn clone(&self) -> PackageRef
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 PackageRef
impl Debug for PackageRef
Source§impl<'de> Deserialize<'de> for PackageRef
impl<'de> Deserialize<'de> for PackageRef
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 FromStr for PackageRef
impl FromStr for PackageRef
Source§impl PartialEq for PackageRef
impl PartialEq for PackageRef
Source§impl Serialize for PackageRef
impl Serialize for PackageRef
Source§impl Validate for PackageRef
impl Validate for PackageRef
impl Eq for PackageRef
impl StructuralPartialEq for PackageRef
Auto Trait Implementations§
impl Freeze for PackageRef
impl RefUnwindSafe for PackageRef
impl Send for PackageRef
impl Sync for PackageRef
impl Unpin for PackageRef
impl UnwindSafe for PackageRef
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