Struct mz_segment::Client
source · pub struct Client {
pub(crate) client_side: bool,
pub(crate) tx: Sender<BatchMessage>,
}
Expand description
A Segment API client.
Event delivery is best effort. There is no guarantee that a given event will be delivered to Segment.
Fields§
§client_side: bool
§tx: Sender<BatchMessage>
Implementations§
source§impl Client
impl Client
sourcepub fn track<S>(
&self,
user_id: Uuid,
event: S,
properties: Value,
context: Option<Value>,
timestamp: Option<DateTime<Utc>>,
)
pub fn track<S>( &self, user_id: Uuid, event: S, properties: Value, context: Option<Value>, timestamp: Option<DateTime<Utc>>, )
Sends a new track event to Segment.
Delivery happens asynchronously on a background thread. It is best effort. There is no guarantee that the event will be delivered to Segment. Events may be dropped when the client is backlogged. Errors are logged but not returned.
sourcepub fn group(&self, user_id: Uuid, group_id: Uuid, traits: Value)
pub fn group(&self, user_id: Uuid, group_id: Uuid, traits: Value)
Sends a new [group event] to Segment.
Delivery happens asynchronously on a background thread. It is best effort. There is no guarantee that the event will be delivered to Segment. Events may be dropped when the client is backlogged. Errors are logged but not returned.
pub(crate) fn send(&self, message: BatchMessage)
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request