pub struct PostUpdateEnvelope {
pub posts: Vec<PostUpdate>,
}Expand description
Request envelope for PUT /ghost/api/admin/posts/{id}/.
The Ghost Admin API requires the update payload to be wrapped in a
top-level posts array even when updating a single post.
§Example
use ghost_io_api::models::post::{PostUpdate, PostUpdateEnvelope};
use serde_json;
let envelope = PostUpdateEnvelope::new(PostUpdate::new("2026-01-01T12:00:00.000Z"));
let json = serde_json::to_value(&envelope).unwrap();
assert!(json["posts"].is_array());
assert_eq!(json["posts"][0]["updated_at"], "2026-01-01T12:00:00.000Z");Fields§
§posts: Vec<PostUpdate>Single-element array containing the post update payload.
Implementations§
Source§impl PostUpdateEnvelope
impl PostUpdateEnvelope
Sourcepub fn new(post: PostUpdate) -> Self
pub fn new(post: PostUpdate) -> Self
Wraps a single PostUpdate in the envelope Ghost expects.
§Example
use ghost_io_api::models::post::{PostUpdate, PostUpdateEnvelope};
let envelope = PostUpdateEnvelope::new(PostUpdate::new("2026-01-01T12:00:00.000Z"));
assert_eq!(envelope.posts.len(), 1);
assert_eq!(envelope.posts[0].updated_at, "2026-01-01T12:00:00.000Z");Trait Implementations§
Source§impl Clone for PostUpdateEnvelope
impl Clone for PostUpdateEnvelope
Source§fn clone(&self) -> PostUpdateEnvelope
fn clone(&self) -> PostUpdateEnvelope
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PostUpdateEnvelope
impl Debug for PostUpdateEnvelope
Source§impl<'de> Deserialize<'de> for PostUpdateEnvelope
impl<'de> Deserialize<'de> for PostUpdateEnvelope
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 PostUpdateEnvelope
impl RefUnwindSafe for PostUpdateEnvelope
impl Send for PostUpdateEnvelope
impl Sync for PostUpdateEnvelope
impl Unpin for PostUpdateEnvelope
impl UnsafeUnpin for PostUpdateEnvelope
impl UnwindSafe for PostUpdateEnvelope
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