pub struct ContentRepository { /* private fields */ }Implementations§
Source§impl ContentRepository
impl ContentRepository
pub fn new(db: &DbPool) -> Result<Self, ContentError>
pub async fn create( &self, params: &CreateContentParams, ) -> Result<Content, Error>
pub async fn get_by_id(&self, id: &ContentId) -> Result<Option<Content>, Error>
pub async fn get_by_slug(&self, slug: &str) -> Result<Option<Content>, Error>
pub async fn get_by_source_and_slug( &self, source_id: &SourceId, slug: &str, ) -> Result<Option<Content>, Error>
pub async fn list(&self, limit: i64, offset: i64) -> Result<Vec<Content>, Error>
pub async fn list_by_source( &self, source_id: &SourceId, ) -> Result<Vec<Content>, Error>
pub async fn list_by_source_limited( &self, source_id: &SourceId, limit: i64, ) -> Result<Vec<Content>, Error>
pub async fn update( &self, params: &UpdateContentParams, ) -> Result<Content, Error>
pub async fn category_exists( &self, category_id: &CategoryId, ) -> Result<bool, Error>
pub async fn delete(&self, id: &ContentId) -> Result<(), Error>
pub async fn delete_by_source(&self, source_id: &SourceId) -> Result<u64, Error>
pub async fn list_all( &self, limit: i64, offset: i64, ) -> Result<Vec<Content>, Error>
pub async fn get_popular_content_ids( &self, source_id: &SourceId, days: i32, limit: i64, ) -> Result<Vec<ContentId>, Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ContentRepository
impl !RefUnwindSafe for ContentRepository
impl Send for ContentRepository
impl Sync for ContentRepository
impl Unpin for ContentRepository
impl !UnwindSafe for ContentRepository
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