pub struct ArticleService { /* private fields */ }Implementations§
Source§impl ArticleService
impl ArticleService
pub async fn new(config: DbConfig) -> Self
pub async fn get_article_by_slug( &self, slug: &str, ) -> Result<Article, Box<dyn Error>>
pub async fn get_article_by_id( &self, id: Uuid, ) -> Result<Article, Box<dyn Error>>
pub async fn delete_article(&self, id: Uuid) -> Result<(), Box<dyn Error>>
pub async fn list_articles( &self, filter: Option<HashMap<String, String>>, ) -> Result<Vec<Article>, Box<dyn Error>>
pub async fn create_article( &self, title: &str, slug: &str, description: &str, author: &str, ) -> Result<Uuid, Box<dyn Error>>
pub async fn update_article( &self, id: Uuid, title: &str, slug: &str, description: &str, author: Vec<String>, status: Option<&str>, created: Option<DateTime<Utc>>, contents: &str, images: Vec<String>, source: &str, publish: Option<DateTime<Utc>>, ) -> Result<(), Box<dyn Error>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ArticleService
impl !RefUnwindSafe for ArticleService
impl Send for ArticleService
impl Sync for ArticleService
impl Unpin for ArticleService
impl !UnwindSafe for ArticleService
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> 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