pub struct Post {Show 13 fields
pub client: Option<Client>,
pub id: String,
pub slug: Option<String>,
pub appearance: Option<PostAppearance>,
pub language: Option<String>,
pub rtl: bool,
pub created: Option<DateTime<Utc>>,
pub title: Option<String>,
pub body: String,
pub tags: Vec<String>,
pub views: Option<u64>,
pub collection: Option<Collection>,
pub token: Option<String>,
}Expand description
Main struct describing a single Post
Fields§
§client: Option<Client>§id: String§slug: Option<String>§appearance: Option<PostAppearance>§language: Option<String>§rtl: bool§created: Option<DateTime<Utc>>§title: Option<String>§body: String§views: Option<u64>§collection: Option<Collection>§token: Option<String>Implementations§
Source§impl Post
impl Post
Sourcepub fn build_update(&self, body: String) -> PostUpdateBuilder
pub fn build_update(&self, body: String) -> PostUpdateBuilder
Returns a PostUpdateBuilder initialized with a Client, the correct ID, and the specified body text
Sourcepub async fn update(&self, update: PostUpdate) -> Result<Post, ApiError>
pub async fn update(&self, update: PostUpdate) -> Result<Post, ApiError>
Dispatches an update with an existing PostUpdate
Sourcepub async fn move_to(&self, collection: &str) -> Result<MoveResult, ApiError>
pub async fn move_to(&self, collection: &str) -> Result<MoveResult, ApiError>
Moves the post to a Collection by its alias
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Post
impl<'de> Deserialize<'de> for Post
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 Post
impl RefUnwindSafe for Post
impl Send for Post
impl Sync for Post
impl Unpin for Post
impl UnwindSafe for Post
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