[][src]Struct em_client::client::Client

pub struct Client { /* fields omitted */ }

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 AccountsApi for Client[src]

type Error = ApiError

impl AppApi for Client[src]

type Error = ApiError

impl AuthApi for Client[src]

type Error = ApiError

impl BuildApi for Client[src]

type Error = ApiError

impl CertificateApi for Client[src]

type Error = ApiError

impl Clone for Client[src]

impl Debug for Client[src]

impl NodeApi for Client[src]

type Error = ApiError

impl SystemApi for Client[src]

type Error = ApiError

impl TaskApi for Client[src]

type Error = ApiError

impl ToolsApi for Client[src]

type Error = ApiError

impl UsersApi for Client[src]

type Error = ApiError

impl ZoneApi 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, E> AccountsApiMut for T where
    T: AccountsApi<Error = E>, 
[src]

type Error = E

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

impl<T, E> Api for T where
    T: AppApi<Error = E> + NodeApi<Error = E> + SystemApi<Error = E> + AuthApi<Error = E> + TaskApi<Error = E> + AccountsApi<Error = E> + ToolsApi<Error = E> + BuildApi<Error = E> + UsersApi<Error = E> + ZoneApi<Error = E> + CertificateApi<Error = E>, 
[src]

type Error = E

impl<T, E> ApiMut for T where
    T: AppApiMut<Error = E> + NodeApiMut<Error = E> + SystemApiMut<Error = E> + AuthApiMut<Error = E> + TaskApiMut<Error = E> + AccountsApiMut<Error = E> + ToolsApiMut<Error = E> + BuildApiMut<Error = E> + UsersApiMut<Error = E> + ZoneApiMut<Error = E> + CertificateApiMut<Error = E>, 
[src]

type Error = E

impl<T, E> AppApiMut for T where
    T: AppApi<Error = E>, 
[src]

type Error = E

impl<T, E> AuthApiMut for T where
    T: AuthApi<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> BuildApiMut for T where
    T: BuildApi<Error = E>, 
[src]

type Error = E

impl<T, E> CertificateApiMut for T where
    T: CertificateApi<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> NodeApiMut for T where
    T: NodeApi<Error = E>, 
[src]

type Error = E

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

type Error = E

impl<T, E> TaskApiMut for T where
    T: TaskApi<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, E> ToolsApiMut for T where
    T: ToolsApi<Error = E>, 
[src]

type Error = E

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

impl<T, E> UsersApiMut for T where
    T: UsersApi<Error = E>, 
[src]

type Error = E

impl<T, E> ZoneApiMut for T where
    T: ZoneApi<Error = E>, 
[src]

type Error = E