pub struct DbClientConfig<'a> {
pub address: Cow<'a, str>,
pub namespace: Cow<'a, str>,
pub database: Cow<'a, str>,
pub auth_level: DbAuthLevel,
pub username: Cow<'a, str>,
pub password: Cow<'a, str>,
pub capacity: usize,
}Fields§
§address: Cow<'a, str>Address of the database instance.
Examples:
"ws://localhost:8000""wss://cloud.surrealdb.com"
Default: "ws://localhost:8000"
namespace: Cow<'a, str>Namespace to use on the database instance.
Default: "test"
database: Cow<'a, str>Database to use inside the database instance.
Default: "test"
auth_level: DbAuthLevelThe kind of the system user used for authentication.
Default: Root
username: Cow<'a, str>Username used to authenticate to the database instance.
Default: "root"
password: Cow<'a, str>Password used to authenticate to the database instance.
Default: "root"
capacity: usizeCapacity of the channels to the database.
Example:
0(= unbounded)200
Default: 20
Implementations§
Source§impl<'a> DbClientConfig<'a>
impl<'a> DbClientConfig<'a>
pub fn with_address(self, address: impl Into<Cow<'a, str>>) -> Self
pub fn with_namespace(self, namespace: impl Into<Cow<'a, str>>) -> Self
pub fn with_database(self, database: impl Into<Cow<'a, str>>) -> Self
pub const fn with_auth_level(self, auth_level: DbAuthLevel) -> Self
pub fn with_username(self, username: impl Into<Cow<'a, str>>) -> Self
pub fn with_password(self, password: impl Into<Cow<'a, str>>) -> Self
pub const fn with_capacity(self, capacity: usize) -> Self
Trait Implementations§
Source§impl<'a> Clone for DbClientConfig<'a>
impl<'a> Clone for DbClientConfig<'a>
Source§fn clone(&self) -> DbClientConfig<'a>
fn clone(&self) -> DbClientConfig<'a>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for DbClientConfig<'a>
impl<'a> Debug for DbClientConfig<'a>
Source§impl Default for DbClientConfig<'_>
impl Default for DbClientConfig<'_>
Source§impl<'a> PartialEq for DbClientConfig<'a>
impl<'a> PartialEq for DbClientConfig<'a>
impl<'a> Eq for DbClientConfig<'a>
impl<'a> StructuralPartialEq for DbClientConfig<'a>
Auto Trait Implementations§
impl<'a> Freeze for DbClientConfig<'a>
impl<'a> RefUnwindSafe for DbClientConfig<'a>
impl<'a> Send for DbClientConfig<'a>
impl<'a> Sync for DbClientConfig<'a>
impl<'a> Unpin for DbClientConfig<'a>
impl<'a> UnwindSafe for DbClientConfig<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.