pub struct Post {Show 19 fields
pub id: i32,
pub author_id: i32,
pub title: String,
pub slug: String,
pub summary: Option<String>,
pub content_md: String,
pub content_html: Option<String>,
pub status: PostStatus,
pub published_at: Option<DateTime<Utc>>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub deleted_at: Option<DateTime<Utc>>,
pub tags: Vec<String>,
pub cover_image: Option<String>,
pub reading_time: u32,
pub word_count: u32,
pub toc_html: Option<String>,
pub prev_post: Option<PostNav>,
pub next_post: Option<PostNav>,
}Expand description
文章领域模型。
Fields§
§id: i32文章主键。
作者用户主键。
title: String文章标题。
slug: StringURL slug,用于生成文章链接。
summary: Option<String>摘要,可选。
content_md: String原始 Markdown 内容。
content_html: Option<String>渲染后的 HTML 内容,可选。
status: PostStatus文章发布状态。
published_at: Option<DateTime<Utc>>正式发布时间,None 表示尚未发布。
created_at: DateTime<Utc>创建时间。
updated_at: DateTime<Utc>最后更新时间。
deleted_at: Option<DateTime<Utc>>软删除时间,None 表示未删除。仅回收站查询填充。
关联标签列表。
cover_image: Option<String>封面图片 URL。
reading_time: u32预计阅读时间(分钟)。
word_count: u32字数统计。
toc_html: Option<String>目录 HTML。
prev_post: Option<PostNav>上一篇文章导航信息。
next_post: Option<PostNav>下一篇文章导航信息。
Implementations§
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
impl StructuralPartialEq for Post
Auto Trait Implementations§
impl Freeze for Post
impl RefUnwindSafe for Post
impl Send for Post
impl Sync for Post
impl Unpin for Post
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.
§impl<T> Transportable for Twhere
T: Serialize + DeserializeOwned + 'static,
impl<T> Transportable for Twhere
T: Serialize + DeserializeOwned + 'static,
§fn transport_to_bytes(&self) -> Vec<u8> ⓘ
fn transport_to_bytes(&self) -> Vec<u8> ⓘ
Serialize the type to a byte vector for transport
§fn transport_from_bytes(bytes: &[u8]) -> Result<T, Error<Error>>
fn transport_from_bytes(bytes: &[u8]) -> Result<T, Error<Error>>
Deserialize the type from a byte slice