pub struct Database(/* private fields */);Implementations§
Source§impl Database
impl Database
Sourcepub async fn get_bucket_info(
&self,
id: &Uuid,
) -> Result<Option<BucketInfo>, Error>
pub async fn get_bucket_info( &self, id: &Uuid, ) -> Result<Option<BucketInfo>, Error>
Get bucket info by ID from the latest bucket_log entry
Sourcepub async fn list_buckets(
&self,
prefix: Option<String>,
limit: Option<u32>,
) -> Result<Vec<BucketInfo>, Error>
pub async fn list_buckets( &self, prefix: Option<String>, limit: Option<u32>, ) -> Result<Vec<BucketInfo>, Error>
List all buckets from the latest bucket_log entries
Sourcepub async fn get_bucket_logs(
&self,
bucket_id: &Uuid,
page: u32,
page_size: u32,
) -> Result<Vec<BucketLogEntry>, Error>
pub async fn get_bucket_logs( &self, bucket_id: &Uuid, page: u32, page_size: u32, ) -> Result<Vec<BucketLogEntry>, Error>
Get paginated bucket log entries for a specific bucket
Trait Implementations§
Source§impl BucketLogProvider for Database
impl BucketLogProvider for Database
type Error = Error
fn exists<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, BucketLogError<Self::Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn heads<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
height: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<Link>, BucketLogError<Self::Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn heads<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
height: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<Link>, BucketLogError<Self::Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the possible heads for a bucket
based on passed height Read more
Source§fn append<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
name: String,
current: Link,
previous: Option<Link>,
height: u64,
published: bool,
) -> Pin<Box<dyn Future<Output = Result<(), BucketLogError<Self::Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn append<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
name: String,
current: Link,
previous: Option<Link>,
height: u64,
published: bool,
) -> Pin<Box<dyn Future<Output = Result<(), BucketLogError<Self::Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Append a version of the bucket to the log Read more
Source§fn height<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<u64, BucketLogError<Self::Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn height<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<u64, BucketLogError<Self::Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return the greatest height of the bucket version within the chain Read more
Source§fn has<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
link: Link,
) -> Pin<Box<dyn Future<Output = Result<Vec<u64>, BucketLogError<Self::Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn has<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
link: Link,
) -> Pin<Box<dyn Future<Output = Result<Vec<u64>, BucketLogError<Self::Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if a link exists within a bucket Read more
Source§fn list_buckets<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>, BucketLogError<Self::Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_buckets<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>, BucketLogError<Self::Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all bucket IDs that have log entries Read more
Auto Trait Implementations§
impl Freeze for Database
impl !RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl !UnwindSafe for Database
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more
Source§fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
Source§fn sensitive_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>where
Self: Sized,
fn sensitive_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>where
Self: Sized,
Source§fn sensitive_request_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<Self>where
Self: Sized,
fn sensitive_request_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<Self>where
Self: Sized,
Source§fn sensitive_response_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveResponseHeaders<Self>where
Self: Sized,
fn sensitive_response_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveResponseHeaders<Self>where
Self: Sized,
Source§fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
Self: Sized,
fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
Self: Sized,
Intercept requests with over-sized payloads and convert them into
413 Payload Too Large responses. Read more