fn from_request(request: &'a Request<'r>) -> request::Outcome<Conn, ()> {
            let pool = match <State<Pool> as FromRequest>::from_request(request) {
                Outcome::Success(pool) => pool,
                Outcome::Failure(e) => return Outcome::Failure(e),
                Outcome::Forward(_) => return Outcome::Forward(()),
            };

            match pool.get() {
                Ok(conn) => Outcome::Success(Conn(conn)),
                Err(_) => Outcome::Failure((Status::ServiceUnavailable, ())),
            }
        }
// Gets the pool from the request and extracts a reference to a connection which is then wrapped in a Conn() and handed to route.
Gets the pool from the request and extracts a reference to a connection which is then wrapped in a Conn() and handed to route.
Gets the pool from the request and extracts a reference to a connection which is then wrapped in a Conn () and handed to route .
fn from_request(request: &'a Request<'r>) -> request::Outcome<Conn, ()> {
            let pool = match <State<Pool> as FromRequest>::from_request(request) {
                Outcome::Success(pool) => pool,
                Outcome::Failure(e) => return Outcome::Failure(e),
                Outcome::Forward(_) => return Outcome::Forward(()),
            };
            match pool.get() {
                Ok(conn) => Outcome::Success(Conn(conn)),
                Err(_) => Outcome::Failure((Status::ServiceUnavailable, ())),
            }
        }
fn from_request ( request : & ' a Request < ' r > ) -> request :: Outcome < Conn , ( ) > { let pool = match < State < Pool > as FromRequest > :: from_request ( request ) { Outcome :: Success ( pool ) => pool , Outcome :: Failure ( e ) => return Outcome :: Failure ( e ) , Outcome :: Forward ( _ ) => return Outcome :: Forward ( ( ) ) , } ; match pool . get ( ) { Ok ( conn ) => Outcome :: Success ( Conn ( conn ) ) , Err ( _ ) => Outcome :: Failure ( ( Status :: ServiceUnavailable , ( ) ) ) , } }
Gets the pool from the request and extracts a reference to a connection which is then wrapped in a Conn() and handed to route.
Gets the pool from the request and extracts a reference to a connection which is then wrapped in a Conn () and handed to route .
request
&'a Request<'r>
request
&'a Request<'r>