segment/
client.rs

1//! Interfaces to the Segment tracking API.
2
3use crate::{Message, Result};
4
5/// `Client` is a trait representing the HTTP transport layer of the analytics library.
6#[async_trait::async_trait]
7pub trait Client {
8    /// Send a single message to Segment using the given write key.
9    ///
10    /// A `write_key` is an API key for Segment's tracking API. See [Segment's
11    /// documentation](https://segment.com/docs/guides/setup/how-do-i-find-my-write-key/)
12    /// for how to find this value.
13    async fn send(&self, write_key: String, msg: Message) -> Result<()>;
14}