[][src]Struct emseries::Series

pub struct Series<T: Clone + Recordable + DeserializeOwned + Serialize> { /* fields omitted */ }

An open time series database.

Any given database can store only one data type, T. The data type must be determined when the database is opened.

Methods

impl<'de, T> Series<T> where
    T: Clone + Recordable + DeserializeOwned + Serialize
[src]

pub fn open(path: &str) -> Result<Series<T>, Error>[src]

Open a time series database at the specified path. path is the full path and filename for the database.

pub fn put(&mut self, entry: T) -> Result<UniqueId, Error>[src]

Put a new record into the database. A unique id will be assigned to the record and returned.

pub fn update(&mut self, record: Record<T>) -> Result<(), Error>[src]

Update an existing record. The UniqueId of the record passed into this function must match the UniqueId of a record already in the database.

pub fn delete(&mut self, uuid: &UniqueId) -> Result<(), Error>[src]

Delete a record from the database

Future note: while this deletes a record from the view, it only adds an entry to the database that indicates data: null. If record histories ever become important, the record and its entire history (including this delete) will still be available.

pub fn all_records(&self) -> Result<Vec<Record<T>>, Error>[src]

Get all of the records in the database.

pub fn search<C>(&self, criteria: C) -> Result<Vec<Record<T>>, Error> where
    C: Criteria
[src]

Perform a search on the records in a database, based on the given criteria.

pub fn search_sorted<C, CMP>(
    &self,
    criteria: C,
    compare: CMP
) -> Result<Vec<Record<T>>, Error> where
    C: Criteria,
    CMP: FnMut(&Record<T>, &Record<T>) -> Ordering
[src]

Perform a search and sort the resulting records based on the comparison.

pub fn get(&self, uuid: &UniqueId) -> Result<Option<Record<T>>, Error>[src]

Get an exact record from the database based on unique id.

Auto Trait Implementations

impl<T> Send for Series<T> where
    T: Send

impl<T> Sync for Series<T> where
    T: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]