pub struct Packager {
name: String,
email: EmailAddress,
}Expand description
A packager of a package
A Packager is represented by a User ID (e.g. "Foobar McFooFace <foobar@mcfooface.org>").
Internally this struct wraps a String for the name and an EmailAddress for a valid email
address.
§Examples
use std::str::FromStr;
use alpm_types::{Error, Packager};
// create Packager from &str
let packager = Packager::from_str("Foobar McFooface <foobar@mcfooface.org>")?;
// get name
assert_eq!("Foobar McFooface", packager.name());
// get email
assert_eq!("foobar@mcfooface.org", packager.email().to_string());
// get email domain
assert_eq!("mcfooface.org", packager.email().domain());
// format as String
assert_eq!(
"Foobar McFooface <foobar@mcfooface.org>",
format!("{}", packager)
);Fields§
§name: String§email: EmailAddressImplementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Packager
impl<'de> Deserialize<'de> for Packager
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
impl Eq for Packager
impl StructuralPartialEq for Packager
Auto Trait Implementations§
impl Freeze for Packager
impl RefUnwindSafe for Packager
impl Send for Packager
impl Sync for Packager
impl Unpin for Packager
impl UnwindSafe for Packager
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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