[][src]Struct logdna_client::client::Client

pub struct Client { /* fields omitted */ }

Client for sending IngestRequests to LogDNA

Methods

impl Client[src]

pub fn new(template: RequestTemplate, runtime: &mut Runtime) -> Self[src]

Create a new client taking a RequestTemplate and Tokio Runtime

Example


let mut rt = Runtime::new().expect("Runtime::new()");
let params = Params::builder()
    .hostname("rust-client-test")
    .tags(Tags::parse("this,is,a,test"))
    .build()
    .expect("Params::builder()");
let request_template = RequestTemplate::builder()
    .params(params)
    .api_key("<your ingestion key>")
    .build()
    .expect("RequestTemplate::builder()");
let client = Client::new(request_template, &mut rt);

pub fn send(&self, body: IngestBody) -> IngestResponse[src]

Send an IngestBody to the LogDNA Ingest API

Returns an IngestResponse, which is a future that must be run on the Tokio Runtime

Auto Trait Implementations

impl Send for Client

impl Sync for Client

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T