[][src]Struct suggestor::web::ToolsDb

pub struct ToolsDb(Connection<Self, MysqlConnection>);

Implementations

impl ToolsDb[src]

pub fn fairing() -> impl Fairing[src]

Returns a fairing that initializes the associated database connection pool.

pub async fn get_one<'_>(__rocket: &'_ Rocket) -> Option<Self>[src]

Retrieves a connection of type Self from the rocket instance. Returns Some as long as Self::fairing() has been attached.

pub async fn run<F, R, '_>(&'_ self, __f: F) -> R where
    F: FnOnce(&mut MysqlConnection) -> R + Send + 'static,
    R: Send + 'static, 
[src]

Runs the provided closure on a thread from a threadpool. The closure will be passed an &mut r2d2::PooledConnection. .awaiting the return value of this function yields the value returned by the closure.

Trait Implementations

impl<'a, 'r> FromRequest<'a, 'r> for ToolsDb[src]

type Error = ()

The associated error to be returned if derivation fails.

Auto Trait Implementations

impl !RefUnwindSafe for ToolsDb

impl Send for ToolsDb

impl Sync for ToolsDb

impl Unpin for ToolsDb

impl !UnwindSafe for ToolsDb

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoCollection<T> for T

impl<T> IntoSql for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,