pub struct UpdatePost {
pub title: Option<String>,
pub source: Option<Option<String>>,
pub platform: Option<Option<PlatformId>>,
pub thumb: Option<Option<FileMetaId>>,
pub content: Option<Vec<Content>>,
pub comments: Option<Vec<Comment>>,
pub published: Option<DateTime<Utc>>,
pub updated: Option<PostUpdated>,
}Available on crate feature
utils only.Expand description
Builder for updating a post’s fields.
Fields left as None are not modified.
For nullable columns (source, platform, thumb), use Some(None) to clear the value.
Fields§
§title: Option<String>§source: Option<Option<String>>§platform: Option<Option<PlatformId>>§thumb: Option<Option<FileMetaId>>§content: Option<Vec<Content>>§comments: Option<Vec<Comment>>§published: Option<DateTime<Utc>>§updated: Option<PostUpdated>Implementations§
Source§impl UpdatePost
impl UpdatePost
Sourcepub fn platform(self, platform: Option<PlatformId>) -> Self
pub fn platform(self, platform: Option<PlatformId>) -> Self
Set or clear the platform.
Sourcepub fn thumb(self, thumb: Option<FileMetaId>) -> Self
pub fn thumb(self, thumb: Option<FileMetaId>) -> Self
Set or clear the thumbnail.
Sourcepub fn updated(self, updated: DateTime<Utc>) -> Self
pub fn updated(self, updated: DateTime<Utc>) -> Self
Unconditionally set the updated timestamp.
Sourcepub fn updated_by_latest(self, updated: DateTime<Utc>) -> Self
pub fn updated_by_latest(self, updated: DateTime<Utc>) -> Self
Set the updated timestamp only if updated is more recent than the stored value.
Trait Implementations§
Source§impl Clone for UpdatePost
impl Clone for UpdatePost
Source§fn clone(&self) -> UpdatePost
fn clone(&self) -> UpdatePost
Returns a duplicate of the value. Read more
1.0.0 · 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 UpdatePost
impl Debug for UpdatePost
Source§impl Default for UpdatePost
impl Default for UpdatePost
Source§fn default() -> UpdatePost
fn default() -> UpdatePost
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for UpdatePost
impl RefUnwindSafe for UpdatePost
impl Send for UpdatePost
impl Sync for UpdatePost
impl Unpin for UpdatePost
impl UnsafeUnpin for UpdatePost
impl UnwindSafe for UpdatePost
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