pub struct DocumentBox {
pub scope: String,
pub created_at: DateTime<Utc>,
}Fields§
§scope: StringScope for the document box
created_at: DateTime<Utc>Date of creation for the document box
Implementations§
Source§impl DocumentBox
impl DocumentBox
Sourcepub async fn query(
db: impl PgExecutor<'_>,
offset: u64,
limit: u64,
) -> Result<Vec<DocumentBox>, Error>
pub async fn query( db: impl PgExecutor<'_>, offset: u64, limit: u64, ) -> Result<Vec<DocumentBox>, Error>
Get a page from the document boxes list
Sourcepub async fn total(db: impl PgExecutor<'_>) -> Result<i64, Error>
pub async fn total(db: impl PgExecutor<'_>) -> Result<i64, Error>
Get the total number of document boxes in the tenant
Sourcepub async fn search_query(
db: impl PgExecutor<'_>,
query: &str,
offset: u64,
limit: u64,
) -> Result<Vec<DocumentBox>, Error>
pub async fn search_query( db: impl PgExecutor<'_>, query: &str, offset: u64, limit: u64, ) -> Result<Vec<DocumentBox>, Error>
Get a page from the document boxes list based on a search query
Sourcepub async fn search_total(
db: impl PgExecutor<'_>,
query: &str,
) -> Result<i64, Error>
pub async fn search_total( db: impl PgExecutor<'_>, query: &str, ) -> Result<i64, Error>
Get the total number of document boxes in the tenant for the specific search query
Sourcepub async fn find_by_scope(
db: impl PgExecutor<'_>,
scope: &str,
) -> Result<Option<DocumentBox>, Error>
pub async fn find_by_scope( db: impl PgExecutor<'_>, scope: &str, ) -> Result<Option<DocumentBox>, Error>
Find a specific document box by scope within a tenant
Sourcepub async fn create(
db: impl PgExecutor<'_>,
scope: String,
) -> Result<DocumentBox, Error>
pub async fn create( db: impl PgExecutor<'_>, scope: String, ) -> Result<DocumentBox, Error>
Creates a document box with the provided scope
Sourcepub async fn delete(
&self,
db: impl PgExecutor<'_>,
) -> Result<PgQueryResult, Error>
pub async fn delete( &self, db: impl PgExecutor<'_>, ) -> Result<PgQueryResult, Error>
Deletes the document box
Trait Implementations§
Source§impl Clone for DocumentBox
impl Clone for DocumentBox
Source§fn clone(&self) -> DocumentBox
fn clone(&self) -> DocumentBox
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 DocumentBox
impl Debug for DocumentBox
Source§impl<'a, R> FromRow<'a, R> for DocumentBox
impl<'a, R> FromRow<'a, R> for DocumentBox
Source§impl Serialize for DocumentBox
impl Serialize for DocumentBox
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for DocumentBox
impl RefUnwindSafe for DocumentBox
impl Send for DocumentBox
impl Sync for DocumentBox
impl Unpin for DocumentBox
impl UnwindSafe for DocumentBox
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 moreCreates a shared type from an unshared type.