pub struct Publisher(/* private fields */);Implementations§
Source§impl Publisher
impl Publisher
pub const MIN_CHAR_LENGTH: usize = 2usize
pub const MAX_CHAR_LENGTH: usize = 256usize
Sourcepub fn new<T: AsRef<str> + Into<CompactString>>(
publisher: T,
) -> Result<Self, PublisherError>
pub fn new<T: AsRef<str> + Into<CompactString>>( publisher: T, ) -> Result<Self, PublisherError>
Creates a new Publisher from any type that implements AsRef<str> and
Into<CompactString>.
§Errors
Returns an Err if the publisher is less than 2 characters long or more than 256 characters
long.
§Examples
use winget_types::locale::Publisher;
let publisher = Publisher::new("Microsoft")?;
assert_eq!(publisher.as_str(), "Microsoft");Sourcepub unsafe fn new_unchecked<T: Into<CompactString>>(publisher: T) -> Self
pub unsafe fn new_unchecked<T: Into<CompactString>>(publisher: T) -> Self
Creates a new Publisher from any type that implements Into<CompactString> without
checking its validity.
§Safety
The publisher must not be less than 2 characters long or more than 256 characters long.
Trait Implementations§
Source§impl Ord for Publisher
impl Ord for Publisher
Source§impl PartialOrd for Publisher
impl PartialOrd for Publisher
Source§impl TryFrom<CompactString> for Publisher
impl TryFrom<CompactString> for Publisher
Source§type Error = PublisherError
type Error = PublisherError
The type returned in the event of a conversion error.
impl Eq for Publisher
impl StructuralPartialEq for Publisher
Auto Trait Implementations§
impl Freeze for Publisher
impl RefUnwindSafe for Publisher
impl Send for Publisher
impl Sync for Publisher
impl Unpin for Publisher
impl UnwindSafe for Publisher
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