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>").unwrap();
// 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: EmailAddress
Implementations§
Trait Implementations§
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§
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)