Trait diesel::connection::BoxableConnection[][src]

pub trait BoxableConnection<DB: Backend>: SimpleConnection + Any { }

A variant of the Connection trait that is usable with dynamic dispatch

If you are looking for a way to use pass database connections for different database backends around in your application this trait won’t help you much. Normally you should only need to use this trait if you are interacting with a connection passed to a Migration


impl<DB: Backend> dyn BoxableConnection<DB>[src]

pub fn downcast_ref<T>(&self) -> Option<&T> where
    T: Connection<Backend = DB> + 'static, 

Downcast the current connection to a specific connection type.

This will return None if the underlying connection does not match the corresponding type, otherwise a reference to the underlying connection is returned

pub fn is<T>(&self) -> bool where
    T: Connection<Backend = DB> + 'static, 

Check if the current connection is a specific connection type


impl<C> BoxableConnection<<C as Connection>::Backend> for C where
    C: Connection + Any

Loading content...