pub struct Storage { /* private fields */ }
Expand description
A file-based, multi-database, multi-user database engine.
Implementations
Stores a copy of all data in this instance to location
.
Creates or opens a multi-database Storage
with its data stored in directory
.
Returns the unique id of the server.
This value is set from the StorageConfiguration
or randomly
generated when creating a server. It shouldn’t be changed after a server
is in use, as doing can cause issues. For example, the vault that
manages encrypted storage uses the server ID to store the vault key. If
the server ID changes, the vault key storage will need to be updated
with the new server ID.
Registers a schema for use within the server.
Trait Implementations
Creates a database named name
using the SchemaName
schema
. Read more
pub fn database<'life0, 'life1, 'async_trait, DB>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<<Storage as StorageConnection>::Database, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
DB: Schema + 'async_trait,
Storage: 'async_trait,
pub fn database<'life0, 'life1, 'async_trait, DB>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<<Storage as StorageConnection>::Database, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
DB: Schema + 'async_trait,
Storage: 'async_trait,
Returns a reference to database name
with schema DB
.
Deletes a database named name
. Read more
Lists the databases in this storage.
Lists the SchemaName
s registered with this storage.
Creates a user.
pub fn set_user_password<'user, 'life0, 'async_trait, U>(
&'life0 self,
user: U,
password: SensitiveString
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>> where
'user: 'async_trait,
'life0: 'async_trait,
U: Into<NamedReference<'user>> + Send + Sync + 'async_trait,
Storage: 'async_trait,
pub fn set_user_password<'user, 'life0, 'async_trait, U>(
&'life0 self,
user: U,
password: SensitiveString
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>> where
'user: 'async_trait,
'life0: 'async_trait,
U: Into<NamedReference<'user>> + Send + Sync + 'async_trait,
Storage: 'async_trait,
Sets a user’s password.
pub fn authenticate<'user, 'life0, 'async_trait, U>(
&'life0 self,
user: U,
authentication: Authentication
) -> Pin<Box<dyn Future<Output = Result<Authenticated, Error>> + Send + 'async_trait, Global>> where
'user: 'async_trait,
'life0: 'async_trait,
U: Into<NamedReference<'user>> + Send + Sync + 'async_trait,
Storage: 'async_trait,
pub fn authenticate<'user, 'life0, 'async_trait, U>(
&'life0 self,
user: U,
authentication: Authentication
) -> Pin<Box<dyn Future<Output = Result<Authenticated, Error>> + Send + 'async_trait, Global>> where
'user: 'async_trait,
'life0: 'async_trait,
U: Into<NamedReference<'user>> + Send + Sync + 'async_trait,
Storage: 'async_trait,
Authenticates as a user with a authentication method.
pub fn add_permission_group_to_user<'user, 'group, 'life0, 'async_trait, U, G>(
&'life0 self,
user: U,
permission_group: G
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>> where
'user: 'async_trait,
'group: 'async_trait,
'life0: 'async_trait,
U: Into<NamedReference<'user>> + Send + Sync + 'async_trait,
G: Into<NamedReference<'group>> + Send + Sync + 'async_trait,
Storage: 'async_trait,
pub fn add_permission_group_to_user<'user, 'group, 'life0, 'async_trait, U, G>(
&'life0 self,
user: U,
permission_group: G
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>> where
'user: 'async_trait,
'group: 'async_trait,
'life0: 'async_trait,
U: Into<NamedReference<'user>> + Send + Sync + 'async_trait,
G: Into<NamedReference<'group>> + Send + Sync + 'async_trait,
Storage: 'async_trait,
Adds a user to a permission group.
pub fn remove_permission_group_from_user<'user, 'group, 'life0, 'async_trait, U, G>(
&'life0 self,
user: U,
permission_group: G
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>> where
'user: 'async_trait,
'group: 'async_trait,
'life0: 'async_trait,
U: Into<NamedReference<'user>> + Send + Sync + 'async_trait,
G: Into<NamedReference<'group>> + Send + Sync + 'async_trait,
Storage: 'async_trait,
pub fn remove_permission_group_from_user<'user, 'group, 'life0, 'async_trait, U, G>(
&'life0 self,
user: U,
permission_group: G
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>> where
'user: 'async_trait,
'group: 'async_trait,
'life0: 'async_trait,
U: Into<NamedReference<'user>> + Send + Sync + 'async_trait,
G: Into<NamedReference<'group>> + Send + Sync + 'async_trait,
Storage: 'async_trait,
Removes a user from a permission group.
pub fn add_role_to_user<'user, 'group, 'life0, 'async_trait, U, G>(
&'life0 self,
user: U,
role: G
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>> where
'user: 'async_trait,
'group: 'async_trait,
'life0: 'async_trait,
U: Into<NamedReference<'user>> + Send + Sync + 'async_trait,
G: Into<NamedReference<'group>> + Send + Sync + 'async_trait,
Storage: 'async_trait,
pub fn add_role_to_user<'user, 'group, 'life0, 'async_trait, U, G>(
&'life0 self,
user: U,
role: G
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>> where
'user: 'async_trait,
'group: 'async_trait,
'life0: 'async_trait,
U: Into<NamedReference<'user>> + Send + Sync + 'async_trait,
G: Into<NamedReference<'group>> + Send + Sync + 'async_trait,
Storage: 'async_trait,
Adds a user to a permission group.
pub fn remove_role_from_user<'user, 'group, 'life0, 'async_trait, U, G>(
&'life0 self,
user: U,
role: G
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>> where
'user: 'async_trait,
'group: 'async_trait,
'life0: 'async_trait,
U: Into<NamedReference<'user>> + Send + Sync + 'async_trait,
G: Into<NamedReference<'group>> + Send + Sync + 'async_trait,
Storage: 'async_trait,
pub fn remove_role_from_user<'user, 'group, 'life0, 'async_trait, U, G>(
&'life0 self,
user: U,
role: G
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>> where
'user: 'async_trait,
'group: 'async_trait,
'life0: 'async_trait,
U: Into<NamedReference<'user>> + Send + Sync + 'async_trait,
G: Into<NamedReference<'group>> + Send + Sync + 'async_trait,
Storage: 'async_trait,
Removes a user from a permission group.
Creates a database named name
with the Schema
provided. Read more
Auto Trait Implementations
impl !RefUnwindSafe for Storage
impl !UnwindSafe for Storage
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more