Expand description
The client is the entrypoint of the whole SDK.
You can create it using Client::builder
or Client::new
.
Examples
use axiom_rs::{Client, Error};
fn main() -> Result<(), Error> {
// Create a new client and get the token, url and (if necesary) org id
// from the environment variables AXIOM_TOKEN, AXIOM_URL and AXIOM_ORG_ID.
let client = Client::new()?;
// Set all available options. Unset options fall back to environment
// variables.
let client = Client::builder()
.with_token("my-token")
.with_url("http://example.org")
.with_org_id("my-org-id")
.build()?;
Ok(())
}
Fields
datasets: Client
virtual_fields: Client
Implementations
sourceimpl Client
impl Client
sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Creates a new client. If you want to configure it, use Client::builder
.
sourcepub async fn validate_credentials(&self) -> Result<()>
pub async fn validate_credentials(&self) -> Result<()>
Make sure the client can properly authenticate against the configured Axiom deployment.
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more