pub struct SigninParams {
pub user: Option<String>,
pub pass: Option<String>,
pub namespace: Option<String>,
pub database: Option<String>,
pub scope: Option<String>,
pub access: Option<String>,
pub vars: HashMap<String, Value>,
}Expand description
Parameters for authentication
Fields§
§user: Option<String>Username for root/namespace/database authentication
pass: Option<String>Password for root/namespace/database authentication
namespace: Option<String>Namespace for authentication
database: Option<String>Database for authentication
scope: Option<String>Scope for record-level authentication (legacy)
access: Option<String>Access method for record-level authentication (v2.0+)
vars: HashMap<String, Value>Additional authentication variables
Implementations§
Source§impl SigninParams
impl SigninParams
Sourcepub fn root(user: impl Into<String>, pass: impl Into<String>) -> Self
pub fn root(user: impl Into<String>, pass: impl Into<String>) -> Self
Create root user authentication
Sourcepub fn namespace(
user: impl Into<String>,
pass: impl Into<String>,
namespace: impl Into<String>,
) -> Self
pub fn namespace( user: impl Into<String>, pass: impl Into<String>, namespace: impl Into<String>, ) -> Self
Create namespace user authentication
Sourcepub fn database(
user: impl Into<String>,
pass: impl Into<String>,
namespace: impl Into<String>,
database: impl Into<String>,
) -> Self
pub fn database( user: impl Into<String>, pass: impl Into<String>, namespace: impl Into<String>, database: impl Into<String>, ) -> Self
Create database user authentication
Sourcepub fn scope(
namespace: impl Into<String>,
database: impl Into<String>,
scope: impl Into<String>,
) -> Self
pub fn scope( namespace: impl Into<String>, database: impl Into<String>, scope: impl Into<String>, ) -> Self
Create scope-based authentication (legacy)
Sourcepub fn access(
namespace: impl Into<String>,
database: impl Into<String>,
access: impl Into<String>,
) -> Self
pub fn access( namespace: impl Into<String>, database: impl Into<String>, access: impl Into<String>, ) -> Self
Create access-based authentication (v2.0+)
Sourcepub fn with_var(self, key: impl Into<String>, value: Value) -> Self
pub fn with_var(self, key: impl Into<String>, value: Value) -> Self
Add an authentication variable
Sourcepub fn to_rpc_params(&self) -> HashMap<String, Value>
pub fn to_rpc_params(&self) -> HashMap<String, Value>
Convert to the format expected by SurrealDB RPC
Trait Implementations§
Source§impl Clone for SigninParams
impl Clone for SigninParams
Source§fn clone(&self) -> SigninParams
fn clone(&self) -> SigninParams
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SigninParams
impl Debug for SigninParams
Source§impl Default for SigninParams
impl Default for SigninParams
Source§fn default() -> SigninParams
fn default() -> SigninParams
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SigninParams
impl<'de> Deserialize<'de> for SigninParams
Source§fn 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
Auto Trait Implementations§
impl Freeze for SigninParams
impl RefUnwindSafe for SigninParams
impl Send for SigninParams
impl Sync for SigninParams
impl Unpin for SigninParams
impl UnsafeUnpin for SigninParams
impl UnwindSafe for SigninParams
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