[][src]Struct em_node_agent_client::client::Client

pub struct Client { /* fields omitted */ }

A client that implements the API by making HTTP calls out to a server.

Implementations

impl Client[src]

pub fn try_new_http(base_path: &str) -> Result<Client, ClientInitError>[src]

Create an HTTP client.

Arguments

  • base_path - base path of the client API, i.e. "www.my-api-implementation.com"

pub fn try_new_with_connector<C, S>(
    base_path: &str,
    protocol: Option<&'static str>,
    connector: C
) -> Result<Client, ClientInitError> where
    C: NetworkConnector<Stream = S> + Send + Sync + 'static,
    S: NetworkStream
[src]

Create a client with a custom implementation of hyper::net::NetworkConnector.

Intended for use with custom implementations of connect for e.g. protocol logging or similar functionality which requires wrapping the transport layer. When wrapping a TCP connection, this function should be used in conjunction with swagger::{http_connector, https_connector, https_mutual_connector}.

For ordinary tcp connections, prefer the use of try_new_http, try_new_https and try_new_https_mutual, to avoid introducing a dependency on the underlying transport layer.

Arguments

  • base_path - base path of the client API, i.e. "www.my-api-implementation.com"
  • protocol - Which protocol to use when constructing the request url, e.g. Some("http")
  • connector - An instance of C: hyper::net::NetworkConnection

pub fn try_new_with_hyper_client(
    hyper_client: Arc<Client>,
    base_path: &str
) -> Result<Client, ClientInitError>
[src]

Constructor for creating a Client by passing in a pre-made hyper client.

One should avoid relying on this function if possible, since it adds a dependency on the underlying transport implementation, which it would be better to abstract away. Therefore, using this function may lead to a loss of code generality, which may make it harder to move the application to a serverless environment, for example.

The reason for this function's existence is to support legacy test code, which did mocking at the hyper layer. This is not a recommended way to write new tests. If other reasons are found for using this function, they should be mentioned here.

This function is deprecated in the upstream openapi-generator which uses newer hyper. However, the suggested replacement does not exist in hyper 0.9.

pub fn headers(&mut self) -> &mut Headers[src]

Trait Implementations

impl CertificateApi for Client[src]

type Error = ApiError

impl Clone for Client[src]

impl Debug for Client[src]

impl EnclaveApi for Client[src]

type Error = ApiError

impl SystemApi for Client[src]

type Error = ApiError

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

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

impl<T, E> Api for T where
    T: EnclaveApi<Error = E> + SystemApi<Error = E> + CertificateApi<Error = E>, 
[src]

type Error = E

impl<T, E> ApiMut for T where
    T: EnclaveApiMut<Error = E> + SystemApiMut<Error = E> + CertificateApiMut<Error = E>, 
[src]

type Error = E

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

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

impl<T, E> CertificateApiMut for T where
    T: CertificateApi<Error = E>, 
[src]

type Error = E

impl<T, E> EnclaveApiMut for T where
    T: EnclaveApi<Error = E>, 
[src]

type Error = E

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

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

impl<T, E> SystemApiMut for T where
    T: SystemApi<Error = E>, 
[src]

type Error = E

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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> Typeable for T where
    T: Any