pub struct ServerDatabase<B: Backend = NoBackend> { /* private fields */ }
Expand description
A database belonging to a CustomServer
.
Implementations§
Source§impl<B: Backend> ServerDatabase<B>
impl<B: Backend> ServerDatabase<B>
Sourcepub fn with_effective_permissions(
&self,
effective_permissions: Permissions,
) -> Option<Self>
pub fn with_effective_permissions( &self, effective_permissions: Permissions, ) -> Option<Self>
Restricts an unauthenticated instance to having effective_permissions
.
Returns None
if a session has already been established.
Methods from Deref<Target = AsyncDatabase>§
Sourcepub fn with_effective_permissions(
&self,
effective_permissions: Permissions,
) -> Option<AsyncDatabase>
pub fn with_effective_permissions( &self, effective_permissions: Permissions, ) -> Option<AsyncDatabase>
Restricts an unauthenticated instance to having effective_permissions
.
Returns None
if a session has already been established.
Sourcepub fn to_blocking(&self) -> Database
pub fn to_blocking(&self) -> Database
Converts this instance into its blocking version, which is able to be used without async.
Sourcepub fn as_blocking(&self) -> &Database
pub fn as_blocking(&self) -> &Database
Returns a reference to this instance’s blocking version, which is able to be used without async.
Trait Implementations§
Source§impl<B: Backend> AsyncConnection for ServerDatabase<B>
Pass-through implementation
impl<B: Backend> AsyncConnection for ServerDatabase<B>
Pass-through implementation
Source§type Storage = CustomServer<B>
type Storage = CustomServer<B>
The
AsyncStorageConnection
type that is paired with this type.Source§fn storage(&self) -> Self::Storage
fn storage(&self) -> Self::Storage
Returns the
StorageConnection
implementor that this database belongs
to.Source§fn list_executed_transactions<'life0, 'async_trait>(
&'life0 self,
starting_id: Option<u64>,
result_limit: Option<u32>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Executed>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_executed_transactions<'life0, 'async_trait>(
&'life0 self,
starting_id: Option<u64>,
result_limit: Option<u32>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Executed>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Lists executed transactions from this
Schema
. By default, a maximum of
1000 entries will be returned, but that limit can be overridden by
setting result_limit
. A hard limit of 100,000 results will be
returned. To begin listing after another known transaction_id
, pass
transaction_id + 1
into starting_id
.Source§fn last_transaction_id<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<u64>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn last_transaction_id<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<u64>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches the last transaction id that has been committed, if any.
Source§fn compact_collection<'life0, 'async_trait, C>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
C: 'async_trait + Collection,
Self: 'async_trait,
'life0: 'async_trait,
fn compact_collection<'life0, 'async_trait, C>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
C: 'async_trait + Collection,
Self: 'async_trait,
'life0: 'async_trait,
Compacts the collection to reclaim unused disk space. Read more
Source§fn compact<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn compact<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Compacts the entire database to reclaim unused disk space. Read more
Source§fn compact_key_value_store<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn compact_key_value_store<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Compacts the key value store to reclaim unused disk space. Read more
Source§fn collection<C>(&self) -> AsyncCollection<'_, Self, C>where
C: Collection,
fn collection<C>(&self) -> AsyncCollection<'_, Self, C>where
C: Collection,
Accesses a collection for the connected
Schema
.Source§fn view<V>(&self) -> AsyncView<'_, Self, V, <V as View>::Key>where
V: SerializedView,
fn view<V>(&self) -> AsyncView<'_, Self, V, <V as View>::Key>where
V: SerializedView,
Accesses a
schema::View
from this connection.Source§impl<B: Backend> AsyncKeyValue for ServerDatabase<B>
Pass-through implementation
impl<B: Backend> AsyncKeyValue for ServerDatabase<B>
Pass-through implementation
Source§fn execute_key_operation<'life0, 'async_trait>(
&'life0 self,
op: KeyOperation,
) -> Pin<Box<dyn Future<Output = Result<Output, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute_key_operation<'life0, 'async_trait>(
&'life0 self,
op: KeyOperation,
) -> Pin<Box<dyn Future<Output = Result<Output, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Executes a single
KeyOperation
.Source§fn set_key<'a, S, V>(
&'a self,
key: S,
value: &'a V,
) -> AsyncBuilder<'a, Self, V>
fn set_key<'a, S, V>( &'a self, key: S, value: &'a V, ) -> AsyncBuilder<'a, Self, V>
Sets
key
to value
. This function returns a builder that is also a
Future. Awaiting the builder will execute Command::Set
with the options
given.Source§fn set_binary_key<'a, S>(
&'a self,
key: S,
bytes: &'a [u8],
) -> AsyncBuilder<'a, Self, ()>
fn set_binary_key<'a, S>( &'a self, key: S, bytes: &'a [u8], ) -> AsyncBuilder<'a, Self, ()>
Sets
key
to bytes
. This function returns a builder that is also
a Future. Awaiting the builder will execute Command::Set
with
the options given.Source§fn set_numeric_key<S, V>(&self, key: S, value: V) -> AsyncBuilder<'_, Self, ()>
fn set_numeric_key<S, V>(&self, key: S, value: V) -> AsyncBuilder<'_, Self, ()>
Sets
key
to value
. This stores the value as a Numeric
,
enabling atomic math operations to be performed on this key. This
function returns a builder that is also a Future. Awaiting the
builder will execute Command::Set
with the options given.Source§fn increment_key_by<S, V>(&self, key: S, value: V) -> AsyncBuilder<'_, Self, V>
fn increment_key_by<S, V>(&self, key: S, value: V) -> AsyncBuilder<'_, Self, V>
Increments
key
by value
. The value stored must be a Numeric
,
otherwise an error will be returned. The result of the increment
will be the value
’s type. For example, if the stored value is
currently a u64
, but value
is a f64
, the current value will be
converted to an f64
, and the stored value will be an f64
.Source§fn decrement_key_by<S, V>(&self, key: S, value: V) -> AsyncBuilder<'_, Self, V>
fn decrement_key_by<S, V>(&self, key: S, value: V) -> AsyncBuilder<'_, Self, V>
Decrements
key
by value
. The value stored must be a Numeric
,
otherwise an error will be returned. The result of the decrement
will be the value
’s type. For example, if the stored value is
currently a u64
, but value
is a f64
, the current value will be
converted to an f64
, and the stored value will be an f64
.Source§fn get_key<S>(&self, key: S) -> AsyncBuilder<'_, Self>
fn get_key<S>(&self, key: S) -> AsyncBuilder<'_, Self>
Gets the value stored at
key
. This function returns a builder that is also a
Future. Awaiting the builder will execute Command::Get
with the options
given.Source§fn delete_key<'life0, 'async_trait, S>(
&'life0 self,
key: S,
) -> Pin<Box<dyn Future<Output = Result<KeyStatus, Error>> + Send + 'async_trait>>
fn delete_key<'life0, 'async_trait, S>( &'life0 self, key: S, ) -> Pin<Box<dyn Future<Output = Result<KeyStatus, Error>> + Send + 'async_trait>>
Deletes the value stored at
key
.Source§fn key_namespace(&self) -> Option<&str>
fn key_namespace(&self) -> Option<&str>
The current namespace.
Source§fn with_key_namespace(&self, namespace: &str) -> Namespaced<'_, Self>
fn with_key_namespace(&self, namespace: &str) -> Namespaced<'_, Self>
Access this Key-Value store within a namespace. When using the returned
Namespaced
instance, all keys specified will be separated into their
own storage designated by namespace
.Source§impl<B: Backend> AsyncLowLevelConnection for ServerDatabase<B>
impl<B: Backend> AsyncLowLevelConnection for ServerDatabase<B>
Source§fn get_from_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
id: DocumentId,
collection: &'life1 CollectionName,
) -> Pin<Box<dyn Future<Output = Result<Option<OwnedDocument>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_from_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
id: DocumentId,
collection: &'life1 CollectionName,
) -> Pin<Box<dyn Future<Output = Result<Option<OwnedDocument>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn list_from_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
ids: Range<DocumentId>,
order: Sort,
limit: Option<u32>,
collection: &'life1 CollectionName,
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedDocument>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_from_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
ids: Range<DocumentId>,
order: Sort,
limit: Option<u32>,
collection: &'life1 CollectionName,
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedDocument>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieves all documents within the range of
ids
from the named
collection
. To retrieve all documents, pass in ..
for ids
. Read moreSource§fn list_headers_from_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
ids: Range<DocumentId>,
order: Sort,
limit: Option<u32>,
collection: &'life1 CollectionName,
) -> Pin<Box<dyn Future<Output = Result<Vec<Header>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_headers_from_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
ids: Range<DocumentId>,
order: Sort,
limit: Option<u32>,
collection: &'life1 CollectionName,
) -> Pin<Box<dyn Future<Output = Result<Vec<Header>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieves all headers within the range of
ids
from the named
collection
. To retrieve all documents, pass in ..
for ids
. Read moreSource§fn count_from_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
ids: Range<DocumentId>,
collection: &'life1 CollectionName,
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn count_from_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
ids: Range<DocumentId>,
collection: &'life1 CollectionName,
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn get_multiple_from_collection<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ids: &'life1 [DocumentId],
collection: &'life2 CollectionName,
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedDocument>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_multiple_from_collection<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ids: &'life1 [DocumentId],
collection: &'life2 CollectionName,
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedDocument>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Retrieves all documents matching
ids
from the named collection
.
Documents that are not found are not returned, but no error will be
generated. Read moreSource§fn compact_collection_by_name<'life0, 'async_trait>(
&'life0 self,
collection: CollectionName,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn compact_collection_by_name<'life0, 'async_trait>(
&'life0 self,
collection: CollectionName,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Compacts the collection to reclaim unused disk space. Read more
Source§fn query_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
view: &'life1 ViewName,
key: Option<SerializedQueryKey>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy,
) -> Pin<Box<dyn Future<Output = Result<Vec<Serialized>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn query_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
view: &'life1 ViewName,
key: Option<SerializedQueryKey>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy,
) -> Pin<Box<dyn Future<Output = Result<Vec<Serialized>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Queries for view entries from the named
view
. Read moreSource§fn query_by_name_with_docs<'life0, 'life1, 'async_trait>(
&'life0 self,
view: &'life1 ViewName,
key: Option<SerializedQueryKey>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy,
) -> Pin<Box<dyn Future<Output = Result<MappedSerializedDocuments, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn query_by_name_with_docs<'life0, 'life1, 'async_trait>(
&'life0 self,
view: &'life1 ViewName,
key: Option<SerializedQueryKey>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy,
) -> Pin<Box<dyn Future<Output = Result<MappedSerializedDocuments, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Queries for view entries from the named
view
with their source
documents. Read moreSource§fn reduce_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
view: &'life1 ViewName,
key: Option<SerializedQueryKey>,
access_policy: AccessPolicy,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn reduce_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
view: &'life1 ViewName,
key: Option<SerializedQueryKey>,
access_policy: AccessPolicy,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Reduces the view entries from the named
view
. Read moreSource§fn reduce_grouped_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
view: &'life1 ViewName,
key: Option<SerializedQueryKey>,
access_policy: AccessPolicy,
) -> Pin<Box<dyn Future<Output = Result<Vec<MappedSerializedValue>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn reduce_grouped_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
view: &'life1 ViewName,
key: Option<SerializedQueryKey>,
access_policy: AccessPolicy,
) -> Pin<Box<dyn Future<Output = Result<Vec<MappedSerializedValue>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Reduces the view entries from the named
view
, reducing the values by each
unique key. Read moreSource§fn delete_docs_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
view: &'life1 ViewName,
key: Option<SerializedQueryKey>,
access_policy: AccessPolicy,
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_docs_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
view: &'life1 ViewName,
key: Option<SerializedQueryKey>,
access_policy: AccessPolicy,
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Deletes all source documents for entries that match within the named
view
. Read moreSource§fn apply_transaction<'life0, 'async_trait>(
&'life0 self,
transaction: Transaction,
) -> Pin<Box<dyn Future<Output = Result<Vec<OperationResult>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn apply_transaction<'life0, 'async_trait>(
&'life0 self,
transaction: Transaction,
) -> Pin<Box<dyn Future<Output = Result<Vec<OperationResult>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Applies a
Transaction
to the Schema
. If any
operation in the Transaction
fails, none of the operations will be
applied to the Schema
.Source§fn insert<'life0, 'life1, 'async_trait, C, PrimaryKey, B>(
&'life0 self,
id: Option<&'life1 PrimaryKey>,
contents: B,
) -> Pin<Box<dyn Future<Output = Result<CollectionHeader<<C as Collection>::PrimaryKey>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
PrimaryKey: KeyEncoding<<C as Collection>::PrimaryKey> + 'async_trait + Send + ?Sized,
C: 'async_trait + Collection,
B: 'async_trait + Into<Bytes> + Send,
Self: 'async_trait,
fn insert<'life0, 'life1, 'async_trait, C, PrimaryKey, B>(
&'life0 self,
id: Option<&'life1 PrimaryKey>,
contents: B,
) -> Pin<Box<dyn Future<Output = Result<CollectionHeader<<C as Collection>::PrimaryKey>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
PrimaryKey: KeyEncoding<<C as Collection>::PrimaryKey> + 'async_trait + Send + ?Sized,
C: 'async_trait + Collection,
B: 'async_trait + Into<Bytes> + Send,
Self: 'async_trait,
Inserts a newly created document into the connected
schema::Schema
for the Collection
C
. If id
is None
a unique id will be
generated. If an id is provided and a document already exists with that
id, a conflict error will be returned. Read moreSource§fn update<'life0, 'life1, 'async_trait, C, D>(
&'life0 self,
doc: &'life1 mut D,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
C: 'async_trait + Collection,
D: 'async_trait + Document<C> + Send + Sync,
Self: 'async_trait,
fn update<'life0, 'life1, 'async_trait, C, D>(
&'life0 self,
doc: &'life1 mut D,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
C: 'async_trait + Collection,
D: 'async_trait + Document<C> + Send + Sync,
Self: 'async_trait,
Updates an existing document in the connected
schema::Schema
for the
Collection
(schema::Collection) C
. Upon success, doc.revision
will be updated with the new revision. Read moreSource§fn overwrite<'a, 'life0, 'life1, 'async_trait, C, PrimaryKey>(
&'life0 self,
id: &'life1 PrimaryKey,
contents: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<CollectionHeader<<C as Collection>::PrimaryKey>, Error>> + Send + 'async_trait>>where
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
C: Collection + 'async_trait,
PrimaryKey: KeyEncoding<<C as Collection>::PrimaryKey> + 'async_trait,
Self: 'async_trait,
fn overwrite<'a, 'life0, 'life1, 'async_trait, C, PrimaryKey>(
&'life0 self,
id: &'life1 PrimaryKey,
contents: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<CollectionHeader<<C as Collection>::PrimaryKey>, Error>> + Send + 'async_trait>>where
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
C: Collection + 'async_trait,
PrimaryKey: KeyEncoding<<C as Collection>::PrimaryKey> + 'async_trait,
Self: 'async_trait,
Overwrites an existing document, or inserts a new document. Upon success,
doc.revision
will be updated with the new revision information. Read moreSource§fn get<'life0, 'life1, 'async_trait, C, PrimaryKey>(
&'life0 self,
id: &'life1 PrimaryKey,
) -> Pin<Box<dyn Future<Output = Result<Option<OwnedDocument>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
C: Collection + 'async_trait,
PrimaryKey: KeyEncoding<<C as Collection>::PrimaryKey> + 'async_trait + ?Sized,
Self: 'async_trait,
fn get<'life0, 'life1, 'async_trait, C, PrimaryKey>(
&'life0 self,
id: &'life1 PrimaryKey,
) -> Pin<Box<dyn Future<Output = Result<Option<OwnedDocument>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
C: Collection + 'async_trait,
PrimaryKey: KeyEncoding<<C as Collection>::PrimaryKey> + 'async_trait + ?Sized,
Self: 'async_trait,
Source§fn get_multiple<'id, 'life0, 'async_trait, C, PrimaryKey, DocumentIds, I>(
&'life0 self,
ids: DocumentIds,
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedDocument>, Error>> + Send + 'async_trait>>where
'id: 'async_trait,
'life0: 'async_trait,
C: Collection + 'async_trait,
DocumentIds: IntoIterator<Item = &'id PrimaryKey, IntoIter = I> + Send + Sync + 'async_trait,
I: Iterator<Item = &'id PrimaryKey> + Send + Sync + 'async_trait,
PrimaryKey: KeyEncoding<<C as Collection>::PrimaryKey> + 'id + 'async_trait + ?Sized,
Self: 'async_trait,
fn get_multiple<'id, 'life0, 'async_trait, C, PrimaryKey, DocumentIds, I>(
&'life0 self,
ids: DocumentIds,
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedDocument>, Error>> + Send + 'async_trait>>where
'id: 'async_trait,
'life0: 'async_trait,
C: Collection + 'async_trait,
DocumentIds: IntoIterator<Item = &'id PrimaryKey, IntoIter = I> + Send + Sync + 'async_trait,
I: Iterator<Item = &'id PrimaryKey> + Send + Sync + 'async_trait,
PrimaryKey: KeyEncoding<<C as Collection>::PrimaryKey> + 'id + 'async_trait + ?Sized,
Self: 'async_trait,
Retrieves all documents matching
ids
. Documents that are not found
are not returned, but no error will be generated. Read moreSource§fn list<'id, 'life0, 'async_trait, C, R, PrimaryKey>(
&'life0 self,
ids: R,
order: Sort,
limit: Option<u32>,
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedDocument>, Error>> + Send + 'async_trait>>where
'id: 'async_trait,
'life0: 'async_trait,
C: Collection + 'async_trait,
R: Into<RangeRef<'id, <C as Collection>::PrimaryKey, PrimaryKey>> + Send + 'async_trait,
PrimaryKey: KeyEncoding<<C as Collection>::PrimaryKey> + PartialEq + 'id + 'async_trait + ?Sized,
<C as Collection>::PrimaryKey: Borrow<PrimaryKey> + PartialEq<PrimaryKey>,
Self: 'async_trait,
fn list<'id, 'life0, 'async_trait, C, R, PrimaryKey>(
&'life0 self,
ids: R,
order: Sort,
limit: Option<u32>,
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedDocument>, Error>> + Send + 'async_trait>>where
'id: 'async_trait,
'life0: 'async_trait,
C: Collection + 'async_trait,
R: Into<RangeRef<'id, <C as Collection>::PrimaryKey, PrimaryKey>> + Send + 'async_trait,
PrimaryKey: KeyEncoding<<C as Collection>::PrimaryKey> + PartialEq + 'id + 'async_trait + ?Sized,
<C as Collection>::PrimaryKey: Borrow<PrimaryKey> + PartialEq<PrimaryKey>,
Self: 'async_trait,
Retrieves all documents within the range of
ids
. To retrieve all
documents, pass in ..
for ids
. Read moreSource§fn list_headers<'id, 'life0, 'async_trait, C, R, PrimaryKey>(
&'life0 self,
ids: R,
order: Sort,
limit: Option<u32>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Header>, Error>> + Send + 'async_trait>>where
'id: 'async_trait,
'life0: 'async_trait,
C: Collection + 'async_trait,
R: Into<RangeRef<'id, <C as Collection>::PrimaryKey, PrimaryKey>> + Send + 'async_trait,
PrimaryKey: KeyEncoding<<C as Collection>::PrimaryKey> + PartialEq + 'id + 'async_trait + ?Sized,
<C as Collection>::PrimaryKey: Borrow<PrimaryKey> + PartialEq<PrimaryKey>,
Self: 'async_trait,
fn list_headers<'id, 'life0, 'async_trait, C, R, PrimaryKey>(
&'life0 self,
ids: R,
order: Sort,
limit: Option<u32>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Header>, Error>> + Send + 'async_trait>>where
'id: 'async_trait,
'life0: 'async_trait,
C: Collection + 'async_trait,
R: Into<RangeRef<'id, <C as Collection>::PrimaryKey, PrimaryKey>> + Send + 'async_trait,
PrimaryKey: KeyEncoding<<C as Collection>::PrimaryKey> + PartialEq + 'id + 'async_trait + ?Sized,
<C as Collection>::PrimaryKey: Borrow<PrimaryKey> + PartialEq<PrimaryKey>,
Self: 'async_trait,
Retrieves all documents within the range of
ids
. To retrieve all
documents, pass in ..
for ids
. Read moreSource§fn count<'id, 'life0, 'async_trait, C, R, PrimaryKey>(
&'life0 self,
ids: R,
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where
'id: 'async_trait,
'life0: 'async_trait,
C: Collection + 'async_trait,
R: Into<RangeRef<'id, <C as Collection>::PrimaryKey, PrimaryKey>> + Send + 'async_trait,
PrimaryKey: KeyEncoding<<C as Collection>::PrimaryKey> + PartialEq + 'id + 'async_trait + ?Sized,
<C as Collection>::PrimaryKey: Borrow<PrimaryKey> + PartialEq<PrimaryKey>,
Self: 'async_trait,
fn count<'id, 'life0, 'async_trait, C, R, PrimaryKey>(
&'life0 self,
ids: R,
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where
'id: 'async_trait,
'life0: 'async_trait,
C: Collection + 'async_trait,
R: Into<RangeRef<'id, <C as Collection>::PrimaryKey, PrimaryKey>> + Send + 'async_trait,
PrimaryKey: KeyEncoding<<C as Collection>::PrimaryKey> + PartialEq + 'id + 'async_trait + ?Sized,
<C as Collection>::PrimaryKey: Borrow<PrimaryKey> + PartialEq<PrimaryKey>,
Self: 'async_trait,
Counts the number of documents within the range of
ids
. Read moreSource§fn delete<'life0, 'life1, 'async_trait, C, H>(
&'life0 self,
doc: &'life1 H,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
C: 'async_trait + Collection,
H: 'async_trait + HasHeader + Send + Sync,
Self: 'async_trait,
fn delete<'life0, 'life1, 'async_trait, C, H>(
&'life0 self,
doc: &'life1 H,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
C: 'async_trait + Collection,
H: 'async_trait + HasHeader + Send + Sync,
Self: 'async_trait,
Removes a
Document
from the database. Read moreSource§fn query<'life0, 'life1, 'async_trait, V, Key>(
&'life0 self,
key: Option<QueryKey<'life1, <V as View>::Key, Key>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy,
) -> Pin<Box<dyn Future<Output = Result<Vec<CollectionMap<<<V as View>::Collection as Collection>::PrimaryKey, <V as View>::Key, <V as View>::Value>>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Key: KeyEncoding<<V as View>::Key> + PartialEq + 'async_trait + ?Sized,
<V as View>::Key: Borrow<Key> + PartialEq<Key>,
V: 'async_trait + SerializedView,
Self: 'async_trait,
fn query<'life0, 'life1, 'async_trait, V, Key>(
&'life0 self,
key: Option<QueryKey<'life1, <V as View>::Key, Key>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy,
) -> Pin<Box<dyn Future<Output = Result<Vec<CollectionMap<<<V as View>::Collection as Collection>::PrimaryKey, <V as View>::Key, <V as View>::Value>>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Key: KeyEncoding<<V as View>::Key> + PartialEq + 'async_trait + ?Sized,
<V as View>::Key: Borrow<Key> + PartialEq<Key>,
V: 'async_trait + SerializedView,
Self: 'async_trait,
Source§fn query_with_docs<'life0, 'life1, 'async_trait, V, Key>(
&'life0 self,
key: Option<QueryKey<'life1, <V as View>::Key, Key>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy,
) -> Pin<Box<dyn Future<Output = Result<MappedDocuments<OwnedDocument, V>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Key: KeyEncoding<<V as View>::Key> + PartialEq + 'async_trait + ?Sized,
<V as View>::Key: Borrow<Key> + PartialEq<Key>,
V: 'async_trait + SerializedView,
Self: 'async_trait,
fn query_with_docs<'life0, 'life1, 'async_trait, V, Key>(
&'life0 self,
key: Option<QueryKey<'life1, <V as View>::Key, Key>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy,
) -> Pin<Box<dyn Future<Output = Result<MappedDocuments<OwnedDocument, V>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Key: KeyEncoding<<V as View>::Key> + PartialEq + 'async_trait + ?Sized,
<V as View>::Key: Borrow<Key> + PartialEq<Key>,
V: 'async_trait + SerializedView,
Self: 'async_trait,
Source§fn query_with_collection_docs<'life0, 'life1, 'async_trait, V, Key>(
&'life0 self,
key: Option<QueryKey<'life1, <V as View>::Key, Key>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy,
) -> Pin<Box<dyn Future<Output = Result<MappedDocuments<CollectionDocument<<V as View>::Collection>, V>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Key: KeyEncoding<<V as View>::Key> + PartialEq + 'async_trait + ?Sized,
<V as View>::Key: Borrow<Key> + PartialEq<Key>,
V: SerializedView + 'async_trait,
<V as View>::Collection: SerializedCollection,
<<V as View>::Collection as SerializedCollection>::Contents: Debug,
Self: 'async_trait,
fn query_with_collection_docs<'life0, 'life1, 'async_trait, V, Key>(
&'life0 self,
key: Option<QueryKey<'life1, <V as View>::Key, Key>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy,
) -> Pin<Box<dyn Future<Output = Result<MappedDocuments<CollectionDocument<<V as View>::Collection>, V>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Key: KeyEncoding<<V as View>::Key> + PartialEq + 'async_trait + ?Sized,
<V as View>::Key: Borrow<Key> + PartialEq<Key>,
V: SerializedView + 'async_trait,
<V as View>::Collection: SerializedCollection,
<<V as View>::Collection as SerializedCollection>::Contents: Debug,
Self: 'async_trait,
Source§fn reduce<'life0, 'life1, 'async_trait, V, Key>(
&'life0 self,
key: Option<QueryKey<'life1, <V as View>::Key, Key>>,
access_policy: AccessPolicy,
) -> Pin<Box<dyn Future<Output = Result<<V as View>::Value, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Key: KeyEncoding<<V as View>::Key> + PartialEq + 'async_trait + ?Sized,
<V as View>::Key: Borrow<Key> + PartialEq<Key>,
V: 'async_trait + SerializedView,
Self: 'async_trait,
fn reduce<'life0, 'life1, 'async_trait, V, Key>(
&'life0 self,
key: Option<QueryKey<'life1, <V as View>::Key, Key>>,
access_policy: AccessPolicy,
) -> Pin<Box<dyn Future<Output = Result<<V as View>::Value, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Key: KeyEncoding<<V as View>::Key> + PartialEq + 'async_trait + ?Sized,
<V as View>::Key: Borrow<Key> + PartialEq<Key>,
V: 'async_trait + SerializedView,
Self: 'async_trait,
Source§fn reduce_grouped<'life0, 'life1, 'async_trait, V, Key>(
&'life0 self,
key: Option<QueryKey<'life1, <V as View>::Key, Key>>,
access_policy: AccessPolicy,
) -> Pin<Box<dyn Future<Output = Result<Vec<MappedValue<<V as View>::Key, <V as View>::Value>>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Key: KeyEncoding<<V as View>::Key> + PartialEq + 'async_trait + ?Sized,
<V as View>::Key: Borrow<Key> + PartialEq<Key>,
V: 'async_trait + SerializedView,
Self: 'async_trait,
fn reduce_grouped<'life0, 'life1, 'async_trait, V, Key>(
&'life0 self,
key: Option<QueryKey<'life1, <V as View>::Key, Key>>,
access_policy: AccessPolicy,
) -> Pin<Box<dyn Future<Output = Result<Vec<MappedValue<<V as View>::Key, <V as View>::Value>>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Key: KeyEncoding<<V as View>::Key> + PartialEq + 'async_trait + ?Sized,
<V as View>::Key: Borrow<Key> + PartialEq<Key>,
V: 'async_trait + SerializedView,
Self: 'async_trait,
Source§fn delete_docs<'life0, 'life1, 'async_trait, V, Key>(
&'life0 self,
key: Option<QueryKey<'life1, <V as View>::Key, Key>>,
access_policy: AccessPolicy,
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Key: KeyEncoding<<V as View>::Key> + PartialEq + 'async_trait + ?Sized,
<V as View>::Key: Borrow<Key> + PartialEq<Key>,
V: 'async_trait + SerializedView,
Self: 'async_trait,
fn delete_docs<'life0, 'life1, 'async_trait, V, Key>(
&'life0 self,
key: Option<QueryKey<'life1, <V as View>::Key, Key>>,
access_policy: AccessPolicy,
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Key: KeyEncoding<<V as View>::Key> + PartialEq + 'async_trait + ?Sized,
<V as View>::Key: Borrow<Key> + PartialEq<Key>,
V: 'async_trait + SerializedView,
Self: 'async_trait,
Deletes all of the documents associated with this view. Read more
Source§impl<B: Backend> AsyncPubSub for ServerDatabase<B>
Uses CustomServer
’s PubSub
relay.
impl<B: Backend> AsyncPubSub for ServerDatabase<B>
Uses CustomServer
’s PubSub
relay.
Source§type Subscriber = Subscriber
type Subscriber = Subscriber
The Subscriber type for this
PubSub
connection.Source§fn create_subscriber<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Subscriber, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_subscriber<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Subscriber, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create a new
Subscriber
for this relay.Source§fn publish_bytes<'life0, 'async_trait>(
&'life0 self,
topic: Vec<u8>,
payload: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn publish_bytes<'life0, 'async_trait>(
&'life0 self,
topic: Vec<u8>,
payload: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Publishes a
payload
to all subscribers of topic
.Source§fn publish_bytes_to_all<'life0, 'async_trait>(
&'life0 self,
topics: impl 'async_trait + IntoIterator<Item = Vec<u8>> + Send,
payload: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn publish_bytes_to_all<'life0, 'async_trait>(
&'life0 self,
topics: impl 'async_trait + IntoIterator<Item = Vec<u8>> + Send,
payload: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Publishes a
payload
to all subscribers of all topics
.Source§fn publish<'life0, 'life1, 'life2, 'async_trait, Topic, Payload>(
&'life0 self,
topic: &'life1 Topic,
payload: &'life2 Payload,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
fn publish<'life0, 'life1, 'life2, 'async_trait, Topic, Payload>( &'life0 self, topic: &'life1 Topic, payload: &'life2 Payload, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
Publishes a
payload
to all subscribers of topic
.Source§fn publish_to_all<'topics, 'life0, 'life1, 'async_trait, Topics, Topic, Payload>(
&'life0 self,
topics: Topics,
payload: &'life1 Payload,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'topics: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Topics: 'async_trait + IntoIterator<Item = &'topics Topic> + Send + 'topics,
Topic: 'async_trait + Serialize + Send + 'topics,
Payload: 'async_trait + Serialize + Send + Sync,
Self: 'async_trait,
fn publish_to_all<'topics, 'life0, 'life1, 'async_trait, Topics, Topic, Payload>(
&'life0 self,
topics: Topics,
payload: &'life1 Payload,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'topics: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Topics: 'async_trait + IntoIterator<Item = &'topics Topic> + Send + 'topics,
Topic: 'async_trait + Serialize + Send + 'topics,
Payload: 'async_trait + Serialize + Send + Sync,
Self: 'async_trait,
Publishes a
payload
to all subscribers of all topics
.Source§impl<B: Backend> Clone for ServerDatabase<B>
impl<B: Backend> Clone for ServerDatabase<B>
Source§impl<B: Backend> Debug for ServerDatabase<B>
impl<B: Backend> Debug for ServerDatabase<B>
Source§impl<B: Backend> Deref for ServerDatabase<B>
impl<B: Backend> Deref for ServerDatabase<B>
Source§impl<'a, B: Backend> From<&'a ServerDatabase<B>> for Database
impl<'a, B: Backend> From<&'a ServerDatabase<B>> for Database
Source§fn from(server: &'a ServerDatabase<B>) -> Self
fn from(server: &'a ServerDatabase<B>) -> Self
Converts to this type from the input type.
Source§impl<B: Backend> From<ServerDatabase<B>> for Database
impl<B: Backend> From<ServerDatabase<B>> for Database
Source§fn from(server: ServerDatabase<B>) -> Self
fn from(server: ServerDatabase<B>) -> Self
Converts to this type from the input type.
Source§impl<B: Backend> HasSchema for ServerDatabase<B>
impl<B: Backend> HasSchema for ServerDatabase<B>
Source§impl<B: Backend> HasSession for ServerDatabase<B>
impl<B: Backend> HasSession for ServerDatabase<B>
Source§fn allowed_to<'a, R, P>(&self, resource_name: R, action: &P) -> bool
fn allowed_to<'a, R, P>(&self, resource_name: R, action: &P) -> bool
Checks if
action
is permitted against resource_name
.Source§fn check_permission<'a, R, P>(
&self,
resource_name: R,
action: &P,
) -> Result<(), Error>
fn check_permission<'a, R, P>( &self, resource_name: R, action: &P, ) -> Result<(), Error>
Checks if
action
is permitted against resource_name
. If permission
is denied, returns a PermissionDenied
error.Auto Trait Implementations§
impl<B> Freeze for ServerDatabase<B>
impl<B = NoBackend> !RefUnwindSafe for ServerDatabase<B>
impl<B> Send for ServerDatabase<B>
impl<B> Sync for ServerDatabase<B>
impl<B> Unpin for ServerDatabase<B>
impl<B = NoBackend> !UnwindSafe for ServerDatabase<B>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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