pub struct Person {
pub name: Option<SmallString>,
pub email: Option<Email>,
pub uri: Option<String>,
pub avatar: Option<String>,
}Expand description
Person (author, contributor, etc.)
Fields§
§name: Option<SmallString>Person’s name (stored inline for names ≤24 bytes)
email: Option<Email>Person’s email address
uri: Option<String>Person’s URI/website
avatar: Option<String>Person’s avatar image URL (JSON Feed only)
Implementations§
Source§impl Person
impl Person
Sourcepub fn from_name(name: impl AsRef<str>) -> Self
pub fn from_name(name: impl AsRef<str>) -> Self
Create person from just a name
§Examples
use feedparser_rs::types::Person;
let person = Person::from_name("John Doe");
assert_eq!(person.name.as_deref(), Some("John Doe"));
assert!(person.email.is_none());
assert!(person.uri.is_none());Sourcepub fn flat_string(&self) -> Option<SmallString>
pub fn flat_string(&self) -> Option<SmallString>
Build flat author string in "Name (email)" format when email is present.
Returns None if neither name nor email is set.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Person
impl RefUnwindSafe for Person
impl Send for Person
impl Sync for Person
impl Unpin for Person
impl UnsafeUnpin for Person
impl UnwindSafe for Person
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