Crate sonnerie_api[−][src]
This is a simple client API for Sonnerie, a timeseries database.
It lets you do a variety of insertions and reads.
Example
extern crate sonnerie_api; fn main() -> std::io::Result<()> { let stream = std::net::TcpStream::connect("localhost:5599")?; let mut client = sonnerie_api::Client::new(stream)?; // read a series (a read transaction is automatically created and closed) let _: Vec<(sonnerie_api::NaiveDateTime,f64)> = client.read_series("fibonacci")?; // start a write transaction client.begin_write()?; client.add_value( "fibonacci", &"2018-01-06T00:00:00".parse().unwrap(), 13.0, )?; // save the transaction client.commit()?; Ok(()) }
Structs
Client |
Sonnerie Client API |
NaiveDateTime |
ISO 8601 combined date and time without timezone. |
ProtocolError |
Error for when client could not understand the server |