[−][src]Struct emseries::Series
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]
T: Clone + Recordable + DeserializeOwned + Serialize,
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]
C: Criteria,
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]
&self,
criteria: C,
compare: CMP
) -> Result<Vec<Record<T>>, Error> where
C: Criteria,
CMP: FnMut(&Record<T>, &Record<T>) -> Ordering,
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
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,