pub struct Transport { /* private fields */ }Expand description
Executes descriptors over one reqwest::Client that never follows a redirect.
Implementations§
Source§impl Transport
impl Transport
pub fn new(options: &ApiClientOptions) -> Result<Self, ApiError>
Sourcepub fn build_request(
&self,
descriptor: &OperationDescriptor,
input: CallInput,
options: &CallOptions,
) -> Result<Request, ApiError>
pub fn build_request( &self, descriptor: &OperationDescriptor, input: CallInput, options: &CallOptions, ) -> Result<Request, ApiError>
The request a call would send, without sending it.
Sourcepub async fn call_empty(
&self,
descriptor: &OperationDescriptor,
input: CallInput,
options: &CallOptions,
) -> Result<(), ApiError>
pub async fn call_empty( &self, descriptor: &OperationDescriptor, input: CallInput, options: &CallOptions, ) -> Result<(), ApiError>
An operation whose success carries no body.
Sourcepub async fn call_json<T: DeserializeOwned>(
&self,
descriptor: &OperationDescriptor,
input: CallInput,
options: &CallOptions,
) -> Result<T, ApiError>
pub async fn call_json<T: DeserializeOwned>( &self, descriptor: &OperationDescriptor, input: CallInput, options: &CallOptions, ) -> Result<T, ApiError>
A JSON operation. An empty body reads as JSON null, which only an optional result type accepts.
Sourcepub async fn call_json_opt<T: DeserializeOwned>(
&self,
descriptor: &OperationDescriptor,
input: CallInput,
options: &CallOptions,
) -> Result<Option<T>, ApiError>
pub async fn call_json_opt<T: DeserializeOwned>( &self, descriptor: &OperationDescriptor, input: CallInput, options: &CallOptions, ) -> Result<Option<T>, ApiError>
A JSON operation that may also answer with no body (or null), which is None.
Sourcepub async fn call_ndjson(
&self,
descriptor: &OperationDescriptor,
input: CallInput,
options: &CallOptions,
) -> Result<NdjsonPage, ApiError>
pub async fn call_ndjson( &self, descriptor: &OperationDescriptor, input: CallInput, options: &CallOptions, ) -> Result<NdjsonPage, ApiError>
An NDJSON export page.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Transport
impl !RefUnwindSafe for Transport
impl Send for Transport
impl Sync for Transport
impl Unpin for Transport
impl UnsafeUnpin for Transport
impl !UnwindSafe for Transport
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