pub struct Client { /* private fields */ }
Expand description
A client for sending data with Influx Line Protocol queries in a convenient way
use url::Url;
use rinfluxdb_lineprotocol::LineBuilder;
use rinfluxdb_lineprotocol::r#async::Client;
# async_std::task::block_on(async {
let client = Client::new(
Url::parse("https://example.com/")?,
Some(("username", "password")),
)?;
let lines = vec![
LineBuilder::new("measurement")
.insert_field("field", 42.0)
.build(),
LineBuilder::new("measurement")
.insert_field("field", 43.0)
.insert_tag("tag", "value")
.build(),
];
client.send("database", &lines).await?;
# Ok::<(), rinfluxdb_lineprotocol::ClientError>(())
# })?;
# Ok::<(), rinfluxdb_lineprotocol::ClientError>(())
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more