Struct Client

Source
pub struct Client { /* private fields */ }
Expand description

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

Implementations§

Source§

impl Client

Source

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

Create an HTTP client.

§Arguments
  • base_path - base path of the client API, i.e. “www.my-api-implementation.com”
Source

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,

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
Source

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

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.

Source

pub fn headers(&mut self) -> &mut Headers

Trait Implementations§

Source§

impl CertificateApi for Client

Source§

type Error = ApiError

Source§

fn get_issue_certificate_response( &self, param_task_id: Uuid, ) -> Result<IssueCertificateResponse, ApiError>

Get result of the certificate issuance
Source§

fn issue_certificate( &self, param_body: IssueCertificateRequest, ) -> Result<IssueCertificateResponse, ApiError>

Submit request for certificate issuance
Source§

impl Clone for Client

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Client

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl EnclaveApi for Client

Source§

type Error = ApiError

Source§

fn get_fortanix_attestation( &self, param_body: GetFortanixAttestationRequest, ) -> Result<GetFortanixAttestationResponse, ApiError>

Get Fortanix attestation for the application
Source§

fn get_target_info(&self) -> Result<TargetInfo, ApiError>

Get Target Info for node provisioning enclave
Source§

impl SystemApi for Client

Auto Trait Implementations§

§

impl Freeze for Client

§

impl !RefUnwindSafe for Client

§

impl Send for Client

§

impl !Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

type Error = E

Source§

fn get_issue_certificate_response( &self, task_id: Uuid, ) -> Result<IssueCertificateResponse, <T as Api>::Error>

Get result of the certificate issuance
Source§

fn issue_certificate( &self, body: IssueCertificateRequest, ) -> Result<IssueCertificateResponse, <T as Api>::Error>

Submit request for certificate issuance
Source§

fn get_fortanix_attestation( &self, body: GetFortanixAttestationRequest, ) -> Result<GetFortanixAttestationResponse, <T as Api>::Error>

Get Fortanix attestation for the application
Source§

fn get_target_info(&self) -> Result<TargetInfo, <T as Api>::Error>

Get Target Info for node provisioning enclave
Source§

fn get_agent_version(&self) -> Result<VersionResponse, <T as Api>::Error>

Get Agent Version
Source§

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

Source§

type Error = E

Source§

fn get_issue_certificate_response( &mut self, task_id: Uuid, ) -> Result<IssueCertificateResponse, <T as ApiMut>::Error>

Get result of the certificate issuance
Source§

fn issue_certificate( &mut self, body: IssueCertificateRequest, ) -> Result<IssueCertificateResponse, <T as ApiMut>::Error>

Submit request for certificate issuance
Source§

fn get_fortanix_attestation( &mut self, body: GetFortanixAttestationRequest, ) -> Result<GetFortanixAttestationResponse, <T as ApiMut>::Error>

Get Fortanix attestation for the application
Source§

fn get_target_info(&mut self) -> Result<TargetInfo, <T as ApiMut>::Error>

Get Target Info for node provisioning enclave
Source§

fn get_agent_version(&mut self) -> Result<VersionResponse, <T as ApiMut>::Error>

Get Agent Version
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

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

Source§

type Error = E

Source§

fn get_issue_certificate_response( &mut self, task_id: Uuid, ) -> Result<IssueCertificateResponse, <T as CertificateApiMut>::Error>

Get result of the certificate issuance
Source§

fn issue_certificate( &mut self, body: IssueCertificateRequest, ) -> Result<IssueCertificateResponse, <T as CertificateApiMut>::Error>

Submit request for certificate issuance
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

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

Source§

type Error = E

Source§

fn get_fortanix_attestation( &mut self, body: GetFortanixAttestationRequest, ) -> Result<GetFortanixAttestationResponse, <T as EnclaveApiMut>::Error>

Get Fortanix attestation for the application
Source§

fn get_target_info(&mut self) -> Result<TargetInfo, <T as EnclaveApiMut>::Error>

Get Target Info for node provisioning enclave
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

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

Source§

type Error = E

Source§

fn get_agent_version( &mut self, ) -> Result<VersionResponse, <T as SystemApiMut>::Error>

Get Agent Version
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Typeable for T
where T: Any,

Source§

fn get_type(&self) -> TypeId

Get the TypeId of this object.