[−][src]Struct json_feed_model::Author
An author of a feed or an item in the feed.
Valid Author
An Author
must have at least one of the name
, url
, or avatar
properties set.
Implementations
impl Author
[src]
pub fn new() -> Self
[src]
Instantiates with an empty JSON object.
pub fn as_map(&self) -> &Map<String, Value>
[src]
Returns the inner Map
as a reference.
pub fn as_map_mut(&mut self) -> &mut Map<String, Value>
[src]
Returns the inner Map
as a mutable reference.
pub fn into_inner(self) -> Map<String, Value>
[src]
Converts the type into the inner Map
.
pub fn name(&self) -> Result<Option<&str>, Error>
[src]
The optional author's name.
pub fn set_name<T>(&mut self, value: T) -> Option<Value> where
T: ToString,
[src]
T: ToString,
Sets the name.
pub fn remove_name(&mut self) -> Option<Value>
[src]
Remove the name.
pub fn url(&self) -> Result<Option<&str>, Error>
[src]
An optional URL for a site which represents the author.
pub fn set_url<T>(&mut self, value: T) -> Option<Value> where
T: ToString,
[src]
T: ToString,
Sets the URL.
pub fn remove_url(&mut self) -> Option<Value>
[src]
Removes the URL.
pub fn avatar(&self) -> Result<Option<&str>, Error>
[src]
An optional URL for an image which represents the author.
pub fn set_avatar<T>(&mut self, value: T) -> Option<Value> where
T: ToString,
[src]
T: ToString,
Sets the avatar.
pub fn remove_avatar(&mut self) -> Option<Value>
[src]
Removes the avatar.
impl Author
[src]
pub fn is_valid(&self, version: &Version<'_>) -> bool
[src]
Verifies if the JSON data complies with a specific Version
of the JSON Feed spec.
Trait Implementations
impl AsMut<Map<String, Value>> for Author
[src]
impl AsRef<Map<String, Value>> for Author
[src]
impl Clone for Author
[src]
impl Debug for Author
[src]
impl Default for Author
[src]
impl<'de> Deserialize<'de> for Author
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl Eq for Author
[src]
impl From<Map<String, Value>> for Author
[src]
impl PartialEq<Author> for Author
[src]
impl PartialEq<Map<String, Value>> for Author
[src]
fn eq(&self, other: &Map<String, Value>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl Serialize for Author
[src]
Auto Trait Implementations
impl RefUnwindSafe for Author
impl Send for Author
impl Sync for Author
impl Unpin for Author
impl UnwindSafe for Author
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,