Struct glassbench::Db
source · [−]pub struct Db {
pub con: Connection,
}
Expand description
Storage interface for Glassbench, wrapping a SQLite connection
All durations are stored as nanoseconds in i64: If the duration of a task exceeds a few centuries it can be assumed benchmarking it isn’t really necessary.
Fields
con: Connection
Implementations
sourceimpl Db
impl Db
sourcepub fn path() -> Result<PathBuf, GlassBenchError>
pub fn path() -> Result<PathBuf, GlassBenchError>
return the name of the glassbench database file
sourcepub fn open() -> Result<Self, GlassBenchError>
pub fn open() -> Result<Self, GlassBenchError>
Create a new instance of DB, creating the sqlite file and the tables if necessary
sourcepub fn save_bench(&mut self, bench: &Bench) -> Result<i64, GlassBenchError>
pub fn save_bench(&mut self, bench: &Bench) -> Result<i64, GlassBenchError>
Save a bench, with included tasks if any. Return the id of the bench
sourcepub fn last_bench_named(
&mut self,
name: &str
) -> Result<Option<Bench>, GlassBenchError>
pub fn last_bench_named(
&mut self,
name: &str
) -> Result<Option<Bench>, GlassBenchError>
Load the last bench having this name
sourcepub fn task_history(
&mut self,
bench_name: &str,
task_name: &str
) -> Result<TaskHistory, GlassBenchError>
pub fn task_history(
&mut self,
bench_name: &str,
task_name: &str
) -> Result<TaskHistory, GlassBenchError>
Load a TaskHistory with all measure for a bench name and task name
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more