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<PackageRef, ModelError>
pub fn parse(input: &str) -> Result<PackageRef, 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<PackageRef, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PackageRef, <__D as Deserializer<'de>>::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§type Err = ModelError
type Err = ModelError
The associated error which can be returned from parsing.
Source§fn from_str(s: &str) -> Result<PackageRef, <PackageRef as FromStr>::Err>
fn from_str(s: &str) -> Result<PackageRef, <PackageRef as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§impl PartialEq for PackageRef
impl PartialEq for PackageRef
Source§impl Serialize for PackageRef
impl Serialize for PackageRef
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.