pub struct Client { /* private fields */ }
Expand description
Entrypoint for interacting with the API client.
Implementations
sourceimpl Client
impl Client
sourcepub fn new<T>(token: T) -> Self where
T: ToString + Debug,
pub fn new<T>(token: T) -> Self where
T: ToString + Debug,
Create a new Client struct. It takes a type that can convert into
an &str (String
or Vec<u8>
for example). As long as the function is
given a valid API key your requests will work.
sourcepub fn set_base_url<H>(&mut self, base_url: H) where
H: Into<String> + Display + Debug,
pub fn set_base_url<H>(&mut self, base_url: H) where
H: Into<String> + Display + Debug,
Set the base URL for the client to something other than the default: https://api2.frontapp.com.
sourcepub fn new_from_env() -> Self
pub fn new_from_env() -> Self
Create a new Client struct from the environment variable: FRONT_API_TOKEN
.
sourcepub async fn request_raw(
&self,
method: Method,
uri: &str,
body: Option<Body>
) -> Result<RequestBuilder>
pub async fn request_raw(
&self,
method: Method,
uri: &str,
body: Option<Body>
) -> Result<RequestBuilder>
Create a raw request to our API.
Trait Implementations
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
impl<T> FutureExt for T
impl<T> FutureExt for T
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
sourceimpl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
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