From a470499dcb4b8399072a0e1eece514c705fb29cb Mon Sep 17 00:00:00 2001 From: Gwenael Treguier Date: Sat, 8 Aug 2015 16:33:08 +0200 Subject: [PATCH] Improve documentation --- src/cache.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cache.rs b/src/cache.rs index 2b3165b..8724766 100644 --- a/src/cache.rs +++ b/src/cache.rs @@ -1,9 +1,11 @@ +//! Prepared statements cache for faster execution. extern crate lru_cache; use {SqliteResult, SqliteConnection, SqliteStatement}; use self::lru_cache::LruCache; -/// Prepared statements are cached for faster execution. +/// Prepared statements cache. +/// /// FIXME limitation: the same SQL can be cached only once... #[derive(Debug)] pub struct StatementCache<'conn> { @@ -12,6 +14,7 @@ pub struct StatementCache<'conn> { } impl<'conn> StatementCache<'conn> { + /// Create a statement cache. pub fn new(conn: &'conn SqliteConnection, capacity: usize) -> StatementCache<'conn> { StatementCache{ conn: conn, cache: LruCache::new(capacity) } }