pub struct Article {Show 13 fields
pub id: Option<Uuid>,
pub title: String,
pub hero_image: String,
pub slug: String,
pub description: String,
pub author: Vec<String>,
pub status: String,
pub created: DateTime<Utc>,
pub content: String,
pub images: Vec<String>,
pub source: String,
pub published: Option<DateTime<Utc>>,
pub kind: ArticleKind,
}Expand description
Represents an article with all its metadata and content
Fields§
§id: Option<Uuid>§title: String§hero_image: String§slug: String§description: String§status: String§created: DateTime<Utc>§content: String§images: Vec<String>§source: String§published: Option<DateTime<Utc>>§kind: ArticleKindImplementations§
Source§impl Article
impl Article
Sourcepub fn add_image(&mut self, image_url: String)
pub fn add_image(&mut self, image_url: String)
Adds a single image URL to the article’s image collection
§Arguments
image_url- URL of the image to add
Sourcepub fn add_images(&mut self, image_urls: Vec<String>)
pub fn add_images(&mut self, image_urls: Vec<String>)
Adds multiple image URLs to the article’s image collection
§Arguments
image_urls- List of image URLs to add
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Article
impl<'de> Deserialize<'de> for Article
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 Article
impl RefUnwindSafe for Article
impl Send for Article
impl Sync for Article
impl Unpin for Article
impl UnwindSafe for Article
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more