pub enum Author {
Object {
key: String,
},
Nested {
author: Keyed,
},
Key(String),
Empty {},
}
Expand description
Struct representing an author link in OL.
There are several different formats in which we can find author references. This enum encapsulates them, and Serde automatically deserializes it into the appropraite variant. We then use the Author::key function to extract the key itself, no matter the variant.
Variants§
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Author
impl<'de> Deserialize<'de> for Author
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
Auto Trait Implementations§
impl Freeze for Author
impl RefUnwindSafe for Author
impl Send for Author
impl Sync for Author
impl Unpin for Author
impl UnwindSafe for Author
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