pub struct PackageDescription(String);
Expand description
Description of a package
This type enforces the following invariants on the contained string:
- No leading/trailing spaces
- Tabs and newlines are substituted with spaces.
- Multiple, consecutive spaces are substituted with a single space.
This is a type alias for String
.
§Examples
use alpm_types::PackageDescription;
// Create PackageDescription from a string slice
let description = PackageDescription::from("my special package ");
assert_eq!(&description.to_string(), "my special package");
Tuple Fields§
§0: String
Implementations§
Trait Implementations§
Source§impl AsRef<str> for PackageDescription
impl AsRef<str> for PackageDescription
Source§impl Clone for PackageDescription
impl Clone for PackageDescription
Source§fn clone(&self) -> PackageDescription
fn clone(&self) -> PackageDescription
Returns a copy 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 PackageDescription
impl Debug for PackageDescription
Source§impl<'de> Deserialize<'de> for PackageDescription
impl<'de> Deserialize<'de> for PackageDescription
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for PackageDescription
impl Display for PackageDescription
Source§impl From<&str> for PackageDescription
impl From<&str> for PackageDescription
Source§fn from(value: &str) -> Self
fn from(value: &str) -> Self
Creates a new PackageDescription
from a string slice.
Trims leading and trailing whitespace. Replaces any new lines and tabs with a space. Replaces any consecutive spaces with a single space.
Source§impl FromStr for PackageDescription
impl FromStr for PackageDescription
Source§impl PartialEq for PackageDescription
impl PartialEq for PackageDescription
Source§impl Serialize for PackageDescription
impl Serialize for PackageDescription
impl Eq for PackageDescription
impl StructuralPartialEq for PackageDescription
Auto Trait Implementations§
impl Freeze for PackageDescription
impl RefUnwindSafe for PackageDescription
impl Send for PackageDescription
impl Sync for PackageDescription
impl Unpin for PackageDescription
impl UnwindSafe for PackageDescription
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