pub struct HttpClient { /* private fields */ }Available on crate feature
client only.Implementations§
Source§impl HttpClient
impl HttpClient
Sourcepub fn new(base_url: impl AsRef<str>) -> Result<Self, HttpClientError>
pub fn new(base_url: impl AsRef<str>) -> Result<Self, HttpClientError>
Create a client from a base URL and target the standard ACP endpoint.
If the URL path is empty, /acp is used. Otherwise /acp is appended
unless the path already ends with /acp.
Sourcepub fn with_endpoint(endpoint: impl AsRef<str>) -> Result<Self, HttpClientError>
pub fn with_endpoint(endpoint: impl AsRef<str>) -> Result<Self, HttpClientError>
Create a client that targets the exact endpoint URL.
Use this when connecting to a server configured with a custom
ServerOptions::path.
Sourcepub fn with_client(
base_url: impl AsRef<str>,
http: Client,
) -> Result<Self, HttpClientError>
pub fn with_client( base_url: impl AsRef<str>, http: Client, ) -> Result<Self, HttpClientError>
Create a client with a custom HTTP client and the standard ACP endpoint.
If the URL path is empty, /acp is used. Otherwise /acp is appended
unless the path already ends with /acp.
Sourcepub fn with_endpoint_and_client(
endpoint: impl AsRef<str>,
http: Client,
) -> Result<Self, HttpClientError>
pub fn with_endpoint_and_client( endpoint: impl AsRef<str>, http: Client, ) -> Result<Self, HttpClientError>
Create a client with a custom HTTP client and exact endpoint URL.
Use this when connecting to a server configured with a custom
ServerOptions::path.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for HttpClient
impl !UnwindSafe for HttpClient
impl Freeze for HttpClient
impl Send for HttpClient
impl Sync for HttpClient
impl Unpin for HttpClient
impl UnsafeUnpin for HttpClient
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Converts this value into a three-state builder argument.
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.