pub struct ServerDatabase<B = NoBackend>
where B: Backend,
{ /* private fields */ }
Expand description

A database belonging to a CustomServer.

Implementations§

source§

impl<B> ServerDatabase<B>
where B: Backend,

source

pub fn with_effective_permissions( &self, effective_permissions: Permissions ) -> Option<ServerDatabase<B>>

Restricts an unauthenticated instance to having effective_permissions. Returns None if a session has already been established.

Methods from Deref<Target = AsyncDatabase>§

source

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.

source

pub fn to_blocking(&self) -> Database

Converts this instance into its blocking version, which is able to be used without async.

source

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> AsyncConnection for ServerDatabase<B>
where B: Backend,

Pass-through implementation

§

type Storage = CustomServer<B>

The AsyncStorageConnection type that is paired with this type.
source§

fn storage(&self) -> <ServerDatabase<B> as AsyncConnection>::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 'life0: 'async_trait, ServerDatabase<B>: '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 'life0: 'async_trait, ServerDatabase<B>: '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 'life0: 'async_trait, C: 'async_trait + Collection, ServerDatabase<B>: '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 'life0: 'async_trait, ServerDatabase<B>: '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 'life0: 'async_trait, ServerDatabase<B>: '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,

Accesses a collection for the connected Schema.
source§

fn view<V>(&self) -> AsyncView<'_, Self, V, <V as View>::Key>
where V: SerializedView,

Accesses a schema::View from this connection.
source§

impl<B> AsyncKeyValue for ServerDatabase<B>
where B: Backend,

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 'life0: 'async_trait, ServerDatabase<B>: 'async_trait,

Executes a single KeyOperation.
source§

fn set_key<S, V, 'a>( &'a self, key: S, value: &'a V ) -> AsyncBuilder<'a, Self, V>
where S: Into<String>, V: Serialize + Send + Sync,

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<S, 'a>( &'a self, key: S, bytes: &'a [u8] ) -> AsyncBuilder<'a, Self, ()>
where S: Into<String>,

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, ()>
where S: Into<String>, V: Into<Numeric>,

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>

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>

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>
where S: Into<String>,

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>>
where 'life0: 'async_trait, S: 'async_trait + Into<String> + Send, Self: 'async_trait,

Deletes the value stored at key.
source§

fn key_namespace(&self) -> Option<&str>

The current namespace.
source§

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> AsyncLowLevelConnection for ServerDatabase<B>
where B: Backend,

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 'life0: 'async_trait, 'life1: 'async_trait, ServerDatabase<B>: 'async_trait,

Retrieves the document with id stored within the named collection. Read more
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 'life0: 'async_trait, 'life1: 'async_trait, ServerDatabase<B>: 'async_trait,

Retrieves all documents within the range of ids from the named collection. To retrieve all documents, pass in .. for ids. Read more
source§

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 'life0: 'async_trait, 'life1: 'async_trait, ServerDatabase<B>: 'async_trait,

Retrieves all headers within the range of ids from the named collection. To retrieve all documents, pass in .. for ids. Read more
source§

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 'life0: 'async_trait, 'life1: 'async_trait, ServerDatabase<B>: 'async_trait,

Counts the number of documents within the range of ids from the named collection. Read more
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 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, ServerDatabase<B>: '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 more
source§

fn compact_collection_by_name<'life0, 'async_trait>( &'life0 self, collection: CollectionName ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, ServerDatabase<B>: '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 'life0: 'async_trait, 'life1: 'async_trait, ServerDatabase<B>: 'async_trait,

Queries for view entries from the named view. Read more
source§

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 'life0: 'async_trait, 'life1: 'async_trait, ServerDatabase<B>: 'async_trait,

Queries for view entries from the named view with their source documents. Read more
source§

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 'life0: 'async_trait, 'life1: 'async_trait, ServerDatabase<B>: 'async_trait,

Reduces the view entries from the named view. Read more
source§

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 'life0: 'async_trait, 'life1: 'async_trait, ServerDatabase<B>: 'async_trait,

Reduces the view entries from the named view, reducing the values by each unique key. Read more
source§

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 'life0: 'async_trait, 'life1: 'async_trait, ServerDatabase<B>: 'async_trait,

Deletes all source documents for entries that match within the named view. Read more
source§

fn apply_transaction<'life0, 'async_trait>( &'life0 self, transaction: Transaction ) -> Pin<Box<dyn Future<Output = Result<Vec<OperationResult>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, ServerDatabase<B>: '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,

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 more
source§

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 more
source§

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 more
source§

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,

Retrieves a stored document from Collection C identified by id. Read more
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,

Retrieves all documents matching ids. Documents that are not found are not returned, but no error will be generated. Read more
source§

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 more
source§

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 more
source§

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 more
source§

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 more
source§

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,

Queries for view entries matching View(super::AsyncView). Read more
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,

Queries for view entries matching View with their source documents. Read more
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,

Queries for view entries matching View with their source documents, deserialized. Read more
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,

Reduces the view entries matching View. Read more
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,

Reduces the view entries matching View, reducing the values by each unique key. Read more
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,

Deletes all of the documents associated with this view. Read more
source§

impl<B> AsyncPubSub for ServerDatabase<B>
where B: Backend,

Uses CustomServer’s PubSub relay.

§

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<<ServerDatabase<B> as AsyncPubSub>::Subscriber, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, ServerDatabase<B>: '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 'life0: 'async_trait, ServerDatabase<B>: 'async_trait,

Publishes a payload to all subscribers of topic.
source§

fn publish_bytes_to_all<'life0, 'async_trait>( &'life0 self, topics: impl IntoIterator<Item = Vec<u8>> + Send + 'async_trait, payload: Vec<u8> ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, ServerDatabase<B>: '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>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Topic: 'async_trait + Serialize + Send + Sync, Payload: 'async_trait + Serialize + Send + Sync, Self: '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,

Publishes a payload to all subscribers of all topics.
source§

impl<B> Clone for ServerDatabase<B>
where B: Backend,

source§

fn clone(&self) -> ServerDatabase<B>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<B> Debug for ServerDatabase<B>
where B: Backend,

source§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<B> Deref for ServerDatabase<B>
where B: Backend,

§

type Target = AsyncDatabase

The resulting type after dereferencing.
source§

fn deref(&self) -> &<ServerDatabase<B> as Deref>::Target

Dereferences the value.
source§

impl<'a, B> From<&'a ServerDatabase<B>> for Database
where B: Backend,

source§

fn from(server: &'a ServerDatabase<B>) -> Database

Converts to this type from the input type.
source§

impl<B> From<ServerDatabase<B>> for Database
where B: Backend,

source§

fn from(server: ServerDatabase<B>) -> Database

Converts to this type from the input type.
source§

impl<B> HasSchema for ServerDatabase<B>
where B: Backend,

source§

fn schematic(&self) -> &Schematic

Returns the schema for the database.
source§

impl<B> HasSession for ServerDatabase<B>
where B: Backend,

source§

fn session(&self) -> Option<&Session>

Returns the currently authenticated session, if any.
source§

fn allowed_to<'a, R, P>(&self, resource_name: R, action: &P) -> bool
where R: AsRef<[Identifier<'a>]>, P: Action,

Checks if action is permitted against resource_name.
source§

fn check_permission<'a, R, P>( &self, resource_name: R, action: &P ) -> Result<(), Error>
where R: AsRef<[Identifier<'a>]>, P: Action,

Checks if action is permitted against resource_name. If permission is denied, returns a PermissionDenied error.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32 ) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more