Struct iron_rusqlite_middleware::RusqliteMiddleware [−][src]
pub struct RusqliteMiddleware { pub pool: RusqlitePool, }
Iron rusqlite middleware
Fields
pool: RusqlitePool
Pool of connections to SQLite through the rusqlite library
Methods
impl RusqliteMiddleware
[src]
impl RusqliteMiddleware
pub fn new<P: AsRef<Path>>(path: P) -> Result<RusqliteMiddleware, Box<Error>>
[src]
pub fn new<P: AsRef<Path>>(path: P) -> Result<RusqliteMiddleware, Box<Error>>
Creates a new pooled connection to the SQLite database using the default options rusqlite
.
The path
should be the path to the SQLite database file on your system.
See rusqlite::Connection::open
for mode details.
pub fn new_with_flags<P: AsRef<Path>>(
path: P,
flags: OpenFlags
) -> Result<RusqliteMiddleware, Box<Error>>
[src]
pub fn new_with_flags<P: AsRef<Path>>(
path: P,
flags: OpenFlags
) -> Result<RusqliteMiddleware, Box<Error>>
Creates a new pooled connection to the SQLite database using the given rusqlite flags
(i.e. rusqlite::OpenFlags
). The path
should be the path to the SQLite database file
on your system.
See rusqlite::Connection::open_with_flags
for mode details.
pub fn get_connection(&self) -> SqliteConnection
[src]
pub fn get_connection(&self) -> SqliteConnection
Get a handle to a pooled connection for the SQLite database. This can be used to execute some SQL commands prior to launching your Iron webserver. An example would be creating tables if they do not currently exist in the database.
Trait Implementations
impl Key for RusqliteMiddleware
[src]
impl Key for RusqliteMiddleware
impl BeforeMiddleware for RusqliteMiddleware
[src]
impl BeforeMiddleware for RusqliteMiddleware
Implementation of the iron::BeforeMiddleware
trait to make this actually Iron middleware.
Auto Trait Implementations
impl Send for RusqliteMiddleware
impl Send for RusqliteMiddleware
impl Sync for RusqliteMiddleware
impl Sync for RusqliteMiddleware