Rust Segment Analytics Client
Segment Analytics Client now available for rust ;)
Usage
Add this to your Cargo.toml
:
[]
= "0.1.3"
and this to your crate root:
extern crate segment_analytics;
Examples
Usage with shared instance across thread.
extern crate segment_analytics;
use Segment;
let segment = new;
let segment1 = segment.clone;
spawn;
Under the hood, one thread worker is in charge of sending the messages to segment endpoint. If the thread drops, a new one is created.
Traits, Properties and Context must implement ToJsonString
(I'm not a fan of current json solutions in rust).
For convenience ToJsonString
is (basically) implemented for HashMap
.
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.