Struct hvcg_governance_openapi_catholic_polity::client::Client [−][src]
pub struct Client<S, C> where
S: Service<(Request<Body>, C), Response = Response<Body>> + Clone + Sync + Send + 'static,
S::Future: Send + 'static,
S::Error: Into<Box<dyn Error + Send + Sync + 'static>> + Display,
C: Clone + Send + Sync + 'static, { /* fields omitted */ }
Expand description
A client that implements the API by making HTTP calls out to a server.
Implementations
pub fn try_new_with_connector(
base_path: &str,
protocol: Option<&'static str>,
connector: Connector
) -> Result<Self, ClientInitError>
pub fn try_new_with_connector(
base_path: &str,
protocol: Option<&'static str>,
connector: Connector
) -> Result<Self, ClientInitError>
Create a client with a custom implementation of hyper::client::Connect.
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::Connector::builder()
.
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. “http://www.my-api-implementation.com”protocol
- Which protocol to use when constructing the request url, e.g.Some("http")
connector
- Implementation ofhyper::client::Connect
to use for the client
impl<C> Client<DropContextService<Client<HttpConnector, Body>, C>, C> where
C: Clone + Send + Sync + 'static,
impl<C> Client<DropContextService<Client<HttpConnector, Body>, C>, C> where
C: Clone + Send + Sync + 'static,
Create an HTTP client.
Arguments
base_path
- base path of the client API, i.e. “http://www.my-api-implementation.com”
impl<C> Client<DropContextService<Client<HttpsConnector<HttpConnector>, Body>, C>, C> where
C: Clone + Send + Sync + 'static,
impl<C> Client<DropContextService<Client<HttpsConnector<HttpConnector>, Body>, C>, C> where
C: Clone + Send + Sync + 'static,
Create a client with a TLS connection to the server
Arguments
base_path
- base path of the client API, i.e. “https://www.my-api-implementation.com”
pub fn try_new_https_pinned<CA>(
base_path: &str,
ca_certificate: CA
) -> Result<Self, ClientInitError> where
CA: AsRef<Path>,
pub fn try_new_https_pinned<CA>(
base_path: &str,
ca_certificate: CA
) -> Result<Self, ClientInitError> where
CA: AsRef<Path>,
Create a client with a TLS connection to the server using a pinned certificate
Arguments
base_path
- base path of the client API, i.e. “https://www.my-api-implementation.com”ca_certificate
- Path to CA certificate used to authenticate the server
Create a client with a mutually authenticated TLS connection to the server.
Arguments
base_path
- base path of the client API, i.e. “https://www.my-api-implementation.com”ca_certificate
- Path to CA certificate used to authenticate the serverclient_key
- Path to the client private keyclient_certificate
- Path to the client’s public certificate associated with the private key
pub fn try_new_with_client_service(
client_service: S,
base_path: &str
) -> Result<Self, ClientInitError>
pub fn try_new_with_client_service(
client_service: S,
base_path: &str
) -> Result<Self, ClientInitError>
Constructor for creating a Client
by passing in a pre-made hyper::service::Service
/
tower::Service
This allows adding custom wrappers around the underlying transport, for example for logging.
Trait Implementations
impl<S, C> Api<C> for Client<S, C> where
S: Service<(Request<Body>, C), Response = Response<Body>> + Clone + Sync + Send + 'static,
S::Future: Send + 'static,
S::Error: Into<Box<dyn Error + Send + Sync + 'static>> + Display,
C: Has<XSpanIdString> + Has<Option<AuthData>> + Clone + Send + Sync + 'static,
impl<S, C> Api<C> for Client<S, C> where
S: Service<(Request<Body>, C), Response = Response<Body>> + Clone + Sync + Send + 'static,
S::Future: Send + 'static,
S::Error: Into<Box<dyn Error + Send + Sync + 'static>> + Display,
C: Has<XSpanIdString> + Has<Option<AuthData>> + Clone + Send + Sync + 'static,
fn poll_ready(
&self,
cx: &mut Context<'_>
) -> Poll<Result<(), Box<dyn Error + Send + Sync + 'static>>>
fn add_deanery<'life0, 'life1, 'async_trait>(
&'life0 self,
param_deanery_mutation: DeaneryMutation,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<AddDeaneryResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn add_deanery<'life0, 'life1, 'async_trait>(
&'life0 self,
param_deanery_mutation: DeaneryMutation,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<AddDeaneryResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Add new deanery
Delete deanery by ID
fn get_deaneries<'life0, 'life1, 'async_trait>(
&'life0 self,
param_diocese_id: Option<Uuid>,
param_name: Option<String>,
param_offset: Option<i32>,
param_count: Option<i32>,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<GetDeaneriesResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_deaneries<'life0, 'life1, 'async_trait>(
&'life0 self,
param_diocese_id: Option<Uuid>,
param_name: Option<String>,
param_offset: Option<i32>,
param_count: Option<i32>,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<GetDeaneriesResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Get deaneries
Find deanery by ID
fn update_deanery<'life0, 'life1, 'async_trait>(
&'life0 self,
param_id: Uuid,
param_deanery_mutation: DeaneryMutation,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<UpdateDeaneryResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn update_deanery<'life0, 'life1, 'async_trait>(
&'life0 self,
param_id: Uuid,
param_deanery_mutation: DeaneryMutation,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<UpdateDeaneryResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Update an existing deanery
fn add_diocese<'life0, 'life1, 'async_trait>(
&'life0 self,
param_diocese_mutation: DioceseMutation,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<AddDioceseResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn add_diocese<'life0, 'life1, 'async_trait>(
&'life0 self,
param_diocese_mutation: DioceseMutation,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<AddDioceseResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Add new diocese
Delete diocese by ID
Find diocese by ID
fn get_dioceses<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
param_province_id: Option<Uuid>,
param_province_code: Option<Code>,
param_province_name: Option<String>,
param_name: Option<String>,
param_location_name: Option<String>,
param_location_address: Option<String>,
param_location_email: Option<String>,
param_person_in_charge: Option<String>,
param_sorts: Option<&'life1 Vec<DioceseSortCriteria>>,
param_offset: Option<i32>,
param_count: Option<i32>,
context: &'life2 C
) -> Pin<Box<dyn Future<Output = Result<GetDiocesesResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn get_dioceses<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
param_province_id: Option<Uuid>,
param_province_code: Option<Code>,
param_province_name: Option<String>,
param_name: Option<String>,
param_location_name: Option<String>,
param_location_address: Option<String>,
param_location_email: Option<String>,
param_person_in_charge: Option<String>,
param_sorts: Option<&'life1 Vec<DioceseSortCriteria>>,
param_offset: Option<i32>,
param_count: Option<i32>,
context: &'life2 C
) -> Pin<Box<dyn Future<Output = Result<GetDiocesesResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Get all dioceses
fn update_diocese<'life0, 'life1, 'async_trait>(
&'life0 self,
param_id: Uuid,
param_diocese_mutation: DioceseMutation,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<UpdateDioceseResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn update_diocese<'life0, 'life1, 'async_trait>(
&'life0 self,
param_id: Uuid,
param_diocese_mutation: DioceseMutation,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<UpdateDioceseResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Update an existing diocese
fn add_institute<'life0, 'life1, 'async_trait>(
&'life0 self,
param_institute_mutation: InstituteMutation,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<AddInstituteResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn add_institute<'life0, 'life1, 'async_trait>(
&'life0 self,
param_institute_mutation: InstituteMutation,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<AddInstituteResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Add new institute
Delete institute by ID
Find institute by ID
fn get_institutes<'life0, 'life1, 'async_trait>(
&'life0 self,
param_name: Option<String>,
param_offset: Option<i32>,
param_count: Option<i32>,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<GetInstitutesResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_institutes<'life0, 'life1, 'async_trait>(
&'life0 self,
param_name: Option<String>,
param_offset: Option<i32>,
param_count: Option<i32>,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<GetInstitutesResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Get institutes
fn update_institute<'life0, 'life1, 'async_trait>(
&'life0 self,
param_id: Uuid,
param_institute_mutation: InstituteMutation,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<UpdateInstituteResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn update_institute<'life0, 'life1, 'async_trait>(
&'life0 self,
param_id: Uuid,
param_institute_mutation: InstituteMutation,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<UpdateInstituteResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Update an existing institute
fn add_parish<'life0, 'life1, 'async_trait>(
&'life0 self,
param_parish_mutation: Option<ParishMutation>,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<AddParishResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn add_parish<'life0, 'life1, 'async_trait>(
&'life0 self,
param_parish_mutation: Option<ParishMutation>,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<AddParishResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Add new parish
Delete parish by ID
Find parish by ID
fn get_parishes<'life0, 'life1, 'async_trait>(
&'life0 self,
param_deanery_id: Option<Uuid>,
param_diocese_id: Option<Uuid>,
param_name: Option<String>,
param_offset: Option<i32>,
param_count: Option<i32>,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<GetParishesResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_parishes<'life0, 'life1, 'async_trait>(
&'life0 self,
param_deanery_id: Option<Uuid>,
param_diocese_id: Option<Uuid>,
param_name: Option<String>,
param_offset: Option<i32>,
param_count: Option<i32>,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<GetParishesResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Get all parishes
fn update_parish<'life0, 'life1, 'async_trait>(
&'life0 self,
param_id: Uuid,
param_parish_mutation: Option<ParishMutation>,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<UpdateParishResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn update_parish<'life0, 'life1, 'async_trait>(
&'life0 self,
param_id: Uuid,
param_parish_mutation: Option<ParishMutation>,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<UpdateParishResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Update an existing parish
fn add_province<'life0, 'life1, 'async_trait>(
&'life0 self,
param_province_mutation: Option<ProvinceMutation>,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<AddProvinceResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn add_province<'life0, 'life1, 'async_trait>(
&'life0 self,
param_province_mutation: Option<ProvinceMutation>,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<AddProvinceResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Add new province
Delete province by ID
Find province by ID
fn get_provinces<'life0, 'life1, 'async_trait>(
&'life0 self,
param_name: Option<String>,
param_province_code: Option<Code>,
param_offset: Option<i32>,
param_count: Option<i32>,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<GetProvincesResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_provinces<'life0, 'life1, 'async_trait>(
&'life0 self,
param_name: Option<String>,
param_province_code: Option<Code>,
param_offset: Option<i32>,
param_count: Option<i32>,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<GetProvincesResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Get all provinces
fn update_province<'life0, 'life1, 'async_trait>(
&'life0 self,
param_id: Uuid,
param_province_mutation: Option<ProvinceMutation>,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<UpdateProvinceResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn update_province<'life0, 'life1, 'async_trait>(
&'life0 self,
param_id: Uuid,
param_province_mutation: Option<ProvinceMutation>,
context: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<UpdateProvinceResponse, ApiError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Update an existing province
Auto Trait Implementations
impl<S, C> RefUnwindSafe for Client<S, C> where
S: RefUnwindSafe,
impl<S, C> UnwindSafe for Client<S, C> where
S: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Binds this API to a context.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more