pub struct Config { /* private fields */ }
Expand description
Configuration struct that contains information needed for Database.
Implementations§
source§impl Config
impl Config
sourcepub fn new() -> Result<Config, VarError>
pub fn new() -> Result<Config, VarError>
Creating new Config
struct with default configuration. (This will get Replit’s Database URL through enviroment variable REPLIT_DB_URL
)
With a possibility of std::env::VarError
due to enviroment variable isn’t exists.
If that happens, You should use Config
’s new_custom_url
for defining your own database URL instead.
sourcepub fn new_custom_url(url: &str) -> Config
pub fn new_custom_url(url: &str) -> Config
Creating a new Config
struct with custom URL configuration.
Auto Trait Implementations§
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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