Enum bonsaidb_core::networking::ServerRequest
source · [−]pub enum ServerRequest {
CreateDatabase {
database: Database,
only_if_needed: bool,
},
DeleteDatabase {
name: String,
},
ListDatabases,
ListAvailableSchemas,
CreateUser {
username: String,
},
SetUserPassword {
user: NamedReference<'static, u64>,
password: SensitiveString,
},
Authenticate {
user: NamedReference<'static, u64>,
authentication: Authentication,
},
AlterUserPermissionGroupMembership {
user: NamedReference<'static, u64>,
group: NamedReference<'static, u64>,
should_be_member: bool,
},
AlterUserRoleMembership {
user: NamedReference<'static, u64>,
role: NamedReference<'static, u64>,
should_be_member: bool,
},
}Expand description
A server-related request.
Variants
CreateDatabase
Fields
database: DatabaseThe database to create.
only_if_needed: boolOnly attempts to create the database if it doesn’t already exist.
Creates a database.
DeleteDatabase
Fields
name: StringThe name of the database to delete.
Deletes the database named name
ListDatabases
Lists all databases.
ListAvailableSchemas
Lists available schemas.
CreateUser
Fields
username: StringThe unique username of the user to create.
Creates a user.
SetUserPassword
Fields
user: NamedReference<'static, u64>The username or id of the user.
password: SensitiveStringThe user’s new password.
Set’s a user’s password.
Authenticate
Fields
user: NamedReference<'static, u64>The username or id of the user.
authentication: AuthenticationThe method of authentication.
Authenticate as a user.
AlterUserPermissionGroupMembership
Fields
user: NamedReference<'static, u64>The username or id of the user.
group: NamedReference<'static, u64>The name or id of the group.
should_be_member: boolWhether the user should be in the group.
Alter’s a user’s membership in a permission group.
AlterUserRoleMembership
Fields
user: NamedReference<'static, u64>The username or id of the user.
role: NamedReference<'static, u64>The name or id of the role.
should_be_member: boolWhether the user should have the role.
Alter’s a user’s role
Trait Implementations
sourceimpl Clone for ServerRequest
impl Clone for ServerRequest
sourcefn clone(&self) -> ServerRequest
fn clone(&self) -> ServerRequest
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for ServerRequest
impl Debug for ServerRequest
sourceimpl<'de> Deserialize<'de> for ServerRequest
impl<'de> Deserialize<'de> for ServerRequest
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Serialize for ServerRequest
impl Serialize for ServerRequest
Auto Trait Implementations
impl RefUnwindSafe for ServerRequest
impl Send for ServerRequest
impl Sync for ServerRequest
impl Unpin for ServerRequest
impl UnwindSafe for ServerRequest
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more