pub struct PackageFamilyName<'ident> { /* 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<'ident> PackageFamilyName<'ident>
impl<'ident> PackageFamilyName<'ident>
Sourcepub fn new<T, S>(
package_name: T,
identity_publisher: S,
) -> PackageFamilyName<'ident>
pub fn new<T, S>( package_name: T, identity_publisher: S, ) -> PackageFamilyName<'ident>
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<'ident> Clone for PackageFamilyName<'ident>
impl<'ident> Clone for PackageFamilyName<'ident>
Source§fn clone(&self) -> PackageFamilyName<'ident>
fn clone(&self) -> PackageFamilyName<'ident>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'ident> Debug for PackageFamilyName<'ident>
impl<'ident> Debug for PackageFamilyName<'ident>
Source§impl<'ident> Default for PackageFamilyName<'ident>
impl<'ident> Default for PackageFamilyName<'ident>
Source§fn default() -> PackageFamilyName<'ident>
fn default() -> PackageFamilyName<'ident>
Source§impl Display for PackageFamilyName<'_>
impl Display 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 · 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<'_>
impl<'ident> Eq for PackageFamilyName<'ident>
Auto Trait Implementations§
impl<'ident> Freeze for PackageFamilyName<'ident>
impl<'ident> RefUnwindSafe for PackageFamilyName<'ident>
impl<'ident> Send for PackageFamilyName<'ident>
impl<'ident> Sync for PackageFamilyName<'ident>
impl<'ident> Unpin for PackageFamilyName<'ident>
impl<'ident> UnwindSafe for PackageFamilyName<'ident>
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,
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