pub struct DatabaseConfig {
pub url: String,
pub namespace: String,
pub database: String,
pub username: Option<String>,
pub password: Option<String>,
pub auth_level: AuthLevel,
}Expand description
Where to connect and how to sign in.
Fields§
§url: Stringws://host:port or wss://host (SurrealDB Cloud).
namespace: String§database: String§username: Option<String>Signs in when set; a server started with --unauthenticated needs none.
password: Option<String>§auth_level: AuthLevelImplementations§
Source§impl DatabaseConfig
impl DatabaseConfig
Sourcepub fn from_env() -> Result<Self>
pub fn from_env() -> Result<Self>
Reads SURREAL_URL (default DEFAULT_URL), SURREAL_NS and
SURREAL_DB (default main), SURREAL_USER and SURREAL_PASS, and
SURREAL_AUTH_LEVEL (root, namespace or database; default
root).
Trait Implementations§
Source§impl Clone for DatabaseConfig
impl Clone for DatabaseConfig
Auto Trait Implementations§
impl Freeze for DatabaseConfig
impl RefUnwindSafe for DatabaseConfig
impl Send for DatabaseConfig
impl Sync for DatabaseConfig
impl Unpin for DatabaseConfig
impl UnsafeUnpin for DatabaseConfig
impl UnwindSafe for DatabaseConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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