pub struct PackageFamilyName { /* private fields */ }Expand description
A Package Family Name is an opaque string derived from only two parts of a package identity - name and publisher.
<Name>_<PublisherId>
For example, the Package Family Name of the Windows Photos app is
Microsoft.Windows.Photos_8wekyb3d8bbwe, where Microsoft.Windows.Photos is the name and
8wekyb3d8bbwe is the publisher ID for Microsoft.
Package Family Name is often referred to as a ‘version-less Package Full Name’.
Implementations§
Source§impl PackageFamilyName
impl PackageFamilyName
Sourcepub fn new(package_name: &str, publisher: &str) -> PackageFamilyName
pub fn new(package_name: &str, publisher: &str) -> PackageFamilyName
Creates a new Package Family Name from a package name and an identity publisher.
This is equivalent to the Windows function PackageNameAndPublisherIdFromFamilyName.
§Examples
let package_family_name = PackageFamilyName::new(
"Microsoft.PowerShell",
"CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"
);
assert_eq!(package_family_name.to_string(), "Microsoft.PowerShell_8wekyb3d8bbwe");Sourcepub fn package_name(&self) -> &str
pub fn package_name(&self) -> &str
Returns the package name as a string slice.
§Examples
let package_family_name = PackageFamilyName::new(
"Microsoft.PowerShell",
"CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"
);
assert_eq!(package_family_name.package_name(), "Microsoft.PowerShell");Sourcepub const fn publisher_id(&self) -> &PublisherId
pub const fn publisher_id(&self) -> &PublisherId
Returns a reference to the Publisher Id.
§Examples
let package_family_name = PackageFamilyName::new(
"Microsoft.PowerShell",
"CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"
);
assert_eq!(package_family_name.publisher_id().as_str(), "8wekyb3d8bbwe");Trait Implementations§
Source§impl Clone for PackageFamilyName
impl Clone for PackageFamilyName
Source§fn clone(&self) -> PackageFamilyName
fn clone(&self) -> PackageFamilyName
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PackageFamilyName
impl Debug for PackageFamilyName
Source§impl Default for PackageFamilyName
impl Default for PackageFamilyName
Source§fn default() -> PackageFamilyName
fn default() -> PackageFamilyName
Source§impl Display for PackageFamilyName
impl Display for PackageFamilyName
impl Eq for PackageFamilyName
Source§impl FromStr for PackageFamilyName
impl FromStr for PackageFamilyName
Source§type Err = PackageFamilyNameError
type Err = PackageFamilyNameError
Source§fn from_str(
s: &str,
) -> Result<PackageFamilyName, <PackageFamilyName as FromStr>::Err>
fn from_str( s: &str, ) -> Result<PackageFamilyName, <PackageFamilyName as FromStr>::Err>
s to return a value of this type. Read moreSource§impl Hash for PackageFamilyName
impl Hash for PackageFamilyName
Source§impl Ord for PackageFamilyName
impl Ord for PackageFamilyName
Source§fn cmp(&self, other: &PackageFamilyName) -> Ordering
fn cmp(&self, other: &PackageFamilyName) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for PackageFamilyName
impl PartialEq for PackageFamilyName
Source§fn eq(&self, other: &PackageFamilyName) -> bool
fn eq(&self, other: &PackageFamilyName) -> bool
Tests for self and other values to be equal, and is used by ==.
Package Family Name is compared case-insensitively.
§Examples
let pfn_1 = PackageFamilyName::new("PowerShell", "CN=, O=, L=, S=, C=");
let pfn_2 = PackageFamilyName::new("powershell", "CN=, O=, L=, S=, C=");
assert_eq!(pfn_1, pfn_2);Source§impl PartialOrd for PackageFamilyName
impl PartialOrd for PackageFamilyName
Auto Trait Implementations§
impl Freeze for PackageFamilyName
impl RefUnwindSafe for PackageFamilyName
impl Send for PackageFamilyName
impl Sync for PackageFamilyName
impl Unpin for PackageFamilyName
impl UnsafeUnpin for PackageFamilyName
impl UnwindSafe for PackageFamilyName
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more