pub struct SurrealConnection {
pub url: Option<String>,
/* private fields */
}Expand description
Connection builder for SurrealDB
Fields§
§url: Option<String>URL to connect to
Implementations§
Source§impl SurrealConnection
impl SurrealConnection
Sourcepub fn auth_root(
self,
username: impl Into<String>,
password: impl Into<String>,
) -> Self
pub fn auth_root( self, username: impl Into<String>, password: impl Into<String>, ) -> Self
Set root authentication
Sourcepub fn auth_namespace(
self,
username: impl Into<String>,
password: impl Into<String>,
) -> Self
pub fn auth_namespace( self, username: impl Into<String>, password: impl Into<String>, ) -> Self
Set namespace authentication
Sourcepub fn auth_database(
self,
username: impl Into<String>,
password: impl Into<String>,
) -> Self
pub fn auth_database( self, username: impl Into<String>, password: impl Into<String>, ) -> Self
Set database authentication
Sourcepub fn auth_scope(
self,
namespace: impl Into<String>,
database: impl Into<String>,
scope: impl Into<String>,
params: Value,
) -> Self
pub fn auth_scope( self, namespace: impl Into<String>, database: impl Into<String>, scope: impl Into<String>, params: Value, ) -> Self
Set scope authentication
Sourcepub fn auth_token(self, token: impl Into<String>) -> Self
pub fn auth_token(self, token: impl Into<String>) -> Self
Set JWT token authentication
Sourcepub fn version_check(self, check: bool) -> Self
pub fn version_check(self, check: bool) -> Self
Set version check flag
Sourcepub fn with_debug(self, enabled: bool) -> Self
pub fn with_debug(self, enabled: bool) -> Self
Enable debug mode for query logging
Sourcepub async fn connect(self) -> Result<SurrealClient>
pub async fn connect(self) -> Result<SurrealClient>
Connect to SurrealDB and return an immutable client
Trait Implementations§
Source§impl Clone for SurrealConnection
impl Clone for SurrealConnection
Source§fn clone(&self) -> SurrealConnection
fn clone(&self) -> SurrealConnection
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 SurrealConnection
impl Debug for SurrealConnection
Source§impl Default for SurrealConnection
impl Default for SurrealConnection
Source§fn default() -> SurrealConnection
fn default() -> SurrealConnection
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SurrealConnection
impl RefUnwindSafe for SurrealConnection
impl Send for SurrealConnection
impl Sync for SurrealConnection
impl Unpin for SurrealConnection
impl UnsafeUnpin for SurrealConnection
impl UnwindSafe for SurrealConnection
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