Struct iron_postgres_middleware::PostgresMiddleware [] [src]

pub struct PostgresMiddleware {
    pub pool: Arc<Pool<PostgresConnectionManager>>,

Iron middleware that allows for postgres connections within requests.



A pool of postgres connections that are shared between requests.


impl PostgresMiddleware

fn new(pg_connection_str: &str) -> Result<PostgresMiddleware, Box<Error>>

Creates a new pooled connection to the given postgresql server. The URL is in the format:


Returns Err(err) if there are any errors connecting to the postgresql database.

Trait Implementations

impl Key for PostgresMiddleware

type Value = Value

impl BeforeMiddleware for PostgresMiddleware

fn before(&self, req: &mut Request) -> IronResult<()>

fn catch(&self, _: &mut Request, err: IronError) -> IronResult<()>