[−][src]Struct libhoney::client::Client
Client represents an object that can create new builders and events and send them somewhere.
Fields
transmission: T
transmission mechanism for the client
Implementations
impl<T> Client<T> where
T: Sender,
[src]
T: Sender,
pub fn new(options: Options, transmission: T) -> Self
[src]
new creates a new Client with the provided Options and initialised Transmission.
Once populated, it auto starts the transmission background threads and is ready to send events.
pub fn add(&mut self, data: HashMap<String, Value>)
[src]
add adds its data to the Client's scope. It adds all fields in a struct or all keys in a map as individual Fields. These metrics will be inherited by all builders and events.
pub fn add_field(&mut self, name: &str, value: Value)
[src]
add_field adds a Field to the Client's scope. This metric will be inherited by all builders and events.
pub fn add_dynamic_field(&mut self, name: &str, func: DynamicFieldFunc)
[src]
add_dynamic_field takes a field name and a function that will generate values for that metric. The function is called once every time a new_event() is created and added as a field (with name as the key) to the newly created event.
pub fn close(self) -> Result<()>
[src]
close waits for all in-flight messages to be sent. You should call close() before app termination.
pub fn flush(&mut self) -> Result<()>
[src]
flush closes and reopens the Transmission, ensuring events are sent without waiting on the batch to be sent asyncronously. Generally, it is more efficient to rely on asyncronous batches than to call Flush, but certain scenarios may require Flush if asynchronous sends are not guaranteed to run (i.e. running in AWS Lambda) Flush is not thread safe - use it only when you are sure that no other parts of your program are calling Send
pub fn new_builder(&self) -> Builder
[src]
new_builder creates a new event builder. The builder inherits any Dynamic or Static Fields present in the Client's scope.
pub fn new_event(&self) -> Event
[src]
new_event creates a new event prepopulated with any Fields present in the Client's scope.
pub fn responses(&self) -> Receiver<Response>
[src]
responses returns a receiver channel with responses
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for Client<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Client<T> where
T: Send,
T: Send,
impl<T> Sync for Client<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Client<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Client<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,
impl<T> WithSubscriber for T
[src]
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,