Struct bb8_mongodb::MongodbConnectionManager
source · [−]pub struct MongodbConnectionManager { /* private fields */ }
Expand description
A bb8
connection manager for the MongoDB
database
Implementations
sourceimpl Mongodb
impl Mongodb
sourcepub fn new<T>(client_options: ClientOptions, db_name: T) -> Mongodb where
T: Into<String>,
pub fn new<T>(client_options: ClientOptions, db_name: T) -> Mongodb where
T: Into<String>,
Create a new MongodbConnectionManager
given mongodb::options::ClientOptions
and a database name
Trait Implementations
sourceimpl ManageConnection for Mongodb
impl ManageConnection for Mongodb
type Connection = Database
type Connection = Database
The connection type this manager deals with.
sourcefn connect<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Attempts to create a new connection.
sourcefn is_valid<'life0, 'life1, 'async_trait>(
&'life0 self,
conn: &'life1 mut Self::Connection
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn is_valid<'life0, 'life1, 'async_trait>(
&'life0 self,
conn: &'life1 mut Self::Connection
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Determines if the connection is still connected to the database.
sourcefn has_broken(&self, _conn: &mut Self::Connection) -> bool
fn has_broken(&self, _conn: &mut Self::Connection) -> bool
Synchronously determine if the connection is no longer usable, if possible.
Auto Trait Implementations
impl !RefUnwindSafe for Mongodb
impl Send for Mongodb
impl Sync for Mongodb
impl Unpin for Mongodb
impl !UnwindSafe for Mongodb
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more