pub struct PostUpdate {Show 29 fields
pub updated_at: String,
pub title: Option<String>,
pub lexical: Option<String>,
pub html: Option<String>,
pub custom_excerpt: Option<String>,
pub slug: Option<String>,
pub status: Option<PostStatus>,
pub visibility: Option<String>,
pub email_only: Option<bool>,
pub featured: Option<bool>,
pub published_at: Option<String>,
pub feature_image: Option<String>,
pub feature_image_alt: Option<String>,
pub feature_image_caption: Option<String>,
pub tags: Option<Vec<TagRef>>,
pub authors: Option<Vec<AuthorRef>>,
pub newsletter: Option<String>,
pub meta_title: Option<String>,
pub meta_description: Option<String>,
pub canonical_url: Option<String>,
pub og_image: Option<String>,
pub og_title: Option<String>,
pub og_description: Option<String>,
pub twitter_image: Option<String>,
pub twitter_title: Option<String>,
pub twitter_description: Option<String>,
pub codeinjection_head: Option<String>,
pub codeinjection_foot: Option<String>,
pub custom_template: Option<String>,
}Expand description
Input model for updating an existing Ghost post via
PUT /ghost/api/admin/posts/{id}/.
updated_at is required by Ghost as an optimistic-concurrency token:
if the value you send does not match the server’s current updated_at,
Ghost rejects the request with a conflict error, preventing silent
overwrite of concurrent edits.
Every other field is optional; only the fields you set will be sent in the
JSON payload. Wrap this in a PostUpdateEnvelope before sending.
§Example
use ghost_io_api::models::post::{PostUpdate, PostStatus, TagRef};
let update = PostUpdate {
updated_at: "2026-01-01T00:00:00.000Z".to_string(),
status: Some(PostStatus::Published),
tags: Some(vec![TagRef::by_slug("rust")]),
..Default::default()
};
assert_eq!(update.updated_at, "2026-01-01T00:00:00.000Z");
assert_eq!(update.status, Some(PostStatus::Published));Fields§
§updated_at: StringISO 8601 timestamp of the post’s last update.
Ghost rejects the request if this does not match the server’s current value, preventing silent overwrites of concurrent edits.
title: Option<String>Updated post title.
lexical: Option<String>Updated rich text content in Lexical JSON format.
html: Option<String>Updated HTML content (alternative to lexical).
custom_excerpt: Option<String>Updated custom excerpt shown in post listings.
slug: Option<String>Updated URL slug.
status: Option<PostStatus>Updated publication status.
visibility: Option<String>Updated visibility: "public", "members", "paid", or "tiers".
email_only: Option<bool>Updated email-only flag.
featured: Option<bool>Updated featured flag.
published_at: Option<String>Updated publication timestamp (ISO 8601). Required when setting
status to "scheduled".
feature_image: Option<String>Updated feature image URL.
feature_image_alt: Option<String>Updated feature image alt text.
feature_image_caption: Option<String>Updated feature image caption.
Replacement tag list. Resolves by slug or creates by name.
Replacement author list. Resolves by id or email.
Updated newsletter slug.
meta_title: Option<String>Updated meta title.
meta_description: Option<String>Updated meta description.
canonical_url: Option<String>Updated canonical URL.
og_image: Option<String>Updated Open Graph image URL.
og_title: Option<String>Updated Open Graph title.
og_description: Option<String>Updated Open Graph description.
twitter_image: Option<String>Updated Twitter Card image URL.
twitter_title: Option<String>Updated Twitter Card title.
twitter_description: Option<String>Updated Twitter Card description.
codeinjection_head: Option<String>Updated <head> code injection.
codeinjection_foot: Option<String>Updated </body> code injection.
custom_template: Option<String>Updated custom theme template name.
Implementations§
Source§impl PostUpdate
impl PostUpdate
Sourcepub fn new(updated_at: impl Into<String>) -> Self
pub fn new(updated_at: impl Into<String>) -> Self
Creates a minimal PostUpdate with only the required updated_at.
All other fields default to None and are omitted from the JSON
payload, so only the fields you explicitly set will be sent.
§Example
use ghost_io_api::models::post::PostUpdate;
let u = PostUpdate::new("2026-01-01T12:00:00.000Z");
assert_eq!(u.updated_at, "2026-01-01T12:00:00.000Z");
assert!(u.title.is_none());
assert!(u.status.is_none());Trait Implementations§
Source§impl Clone for PostUpdate
impl Clone for PostUpdate
Source§fn clone(&self) -> PostUpdate
fn clone(&self) -> PostUpdate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PostUpdate
impl Debug for PostUpdate
Source§impl Default for PostUpdate
impl Default for PostUpdate
Source§fn default() -> PostUpdate
fn default() -> PostUpdate
Source§impl<'de> Deserialize<'de> for PostUpdate
impl<'de> Deserialize<'de> for PostUpdate
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>,
impl Eq for PostUpdate
Source§impl PartialEq for PostUpdate
impl PartialEq for PostUpdate
Source§fn eq(&self, other: &PostUpdate) -> bool
fn eq(&self, other: &PostUpdate) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for PostUpdate
impl Serialize for PostUpdate
impl StructuralPartialEq for PostUpdate
Auto Trait Implementations§
impl Freeze for PostUpdate
impl RefUnwindSafe for PostUpdate
impl Send for PostUpdate
impl Sync for PostUpdate
impl Unpin for PostUpdate
impl UnsafeUnpin for PostUpdate
impl UnwindSafe for PostUpdate
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
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
key and return true if they are equal.