pub struct PortableCommandAlias(/* private fields */);Implementations§
Source§impl PortableCommandAlias
impl PortableCommandAlias
pub const MAX_CHAR_LENGTH: usize = 40usize
Sourcepub fn new<T: AsRef<str> + Into<CompactString>>(
command_alias: T,
) -> Result<Self, PortableCommandAliasError>
pub fn new<T: AsRef<str> + Into<CompactString>>( command_alias: T, ) -> Result<Self, PortableCommandAliasError>
Creates a new PortableCommandAlias from any type that implements AsRef<str> and
Into<CompactString>.
§Errors
Returns an Err if the portable command alias is empty or more than 40 characters long.
§Examples
use winget_types::installer::PortableCommandAlias;
let command_alias = PortableCommandAlias::new("ffmpeg")?;
assert_eq!(command_alias.as_str(), "ffmpeg");Sourcepub unsafe fn new_unchecked<T: Into<CompactString>>(alias: T) -> Self
pub unsafe fn new_unchecked<T: Into<CompactString>>(alias: T) -> Self
Creates a new PortableCommandAlias from any type that implements Into<CompactString>
without checking its validity.
§Safety
The command must not be empty or more than 40 characters long.
Trait Implementations§
Source§impl Clone for PortableCommandAlias
impl Clone for PortableCommandAlias
Source§fn clone(&self) -> PortableCommandAlias
fn clone(&self) -> PortableCommandAlias
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 PortableCommandAlias
impl Debug for PortableCommandAlias
Source§impl Display for PortableCommandAlias
impl Display for PortableCommandAlias
Source§impl FromStr for PortableCommandAlias
impl FromStr for PortableCommandAlias
Source§impl Hash for PortableCommandAlias
impl Hash for PortableCommandAlias
Source§impl Ord for PortableCommandAlias
impl Ord for PortableCommandAlias
Source§fn cmp(&self, other: &PortableCommandAlias) -> Ordering
fn cmp(&self, other: &PortableCommandAlias) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for PortableCommandAlias
impl PartialEq for PortableCommandAlias
Source§impl PartialOrd for PortableCommandAlias
impl PartialOrd for PortableCommandAlias
Source§impl TryFrom<CompactString> for PortableCommandAlias
impl TryFrom<CompactString> for PortableCommandAlias
Source§type Error = PortableCommandAliasError
type Error = PortableCommandAliasError
The type returned in the event of a conversion error.
impl Eq for PortableCommandAlias
impl StructuralPartialEq for PortableCommandAlias
Auto Trait Implementations§
impl Freeze for PortableCommandAlias
impl RefUnwindSafe for PortableCommandAlias
impl Send for PortableCommandAlias
impl Sync for PortableCommandAlias
impl Unpin for PortableCommandAlias
impl UnwindSafe for PortableCommandAlias
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,
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>
Converts
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>
Converts
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>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more