pub trait RestRequest {
type Response: DeserializeOwned;
type QueryParams: Serialize;
type Body: Serialize;
// Required methods
fn path(&self) -> Cow<'static, str>;
fn method() -> Method;
// Provided methods
fn query_params(&self) -> Option<&Self::QueryParams> { ... }
fn body(&self) -> Option<&Self::Body> { ... }
fn timeout() -> Duration { ... }
}Expand description
Http REST request that can be executed by a RestClient.
Required Associated Types§
Sourcetype Response: DeserializeOwned
type Response: DeserializeOwned
Expected response type if this request was successful.
Sourcetype QueryParams: Serialize
type QueryParams: Serialize
Serialisable query parameters type - use unit struct () if not required for this request.
Required Methods§
Sourcefn method() -> Method
fn method() -> Method
Http reqwest::Method of this request.
Provided Methods§
Sourcefn query_params(&self) -> Option<&Self::QueryParams>
fn query_params(&self) -> Option<&Self::QueryParams>
Optional query parameters for this request.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".