pub struct TagRef {
pub name: Option<String>,
pub slug: Option<String>,
}Expand description
Reference to a tag by name or slug, used when creating/updating posts.
At least one of name or slug must be set. Ghost resolves the tag by
slug first; if not found it creates a new tag with the given name.
§Example
use ghost_io_api::models::post::TagRef;
// Reference an existing tag by slug
let existing = TagRef { slug: Some("rust".to_string()), ..Default::default() };
// Create a new tag on the fly
let new_tag = TagRef { name: Some("WebAssembly".to_string()), ..Default::default() };Fields§
§name: Option<String>Tag name (used to create the tag if it does not exist yet).
slug: Option<String>Tag slug (used to look up an existing tag).
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TagRef
impl<'de> Deserialize<'de> for TagRef
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 TagRef
impl StructuralPartialEq for TagRef
Auto Trait Implementations§
impl Freeze for TagRef
impl RefUnwindSafe for TagRef
impl Send for TagRef
impl Sync for TagRef
impl Unpin for TagRef
impl UnsafeUnpin for TagRef
impl UnwindSafe for TagRef
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.