pub trait Request {
type Body: Serialize;
type Response: for<'de> Deserialize<'de>;
const METHOD: Method = Method::GET;
// Required method
fn endpoint(&self) -> Cow<'_, str>;
// Provided methods
fn headers(&self) -> HeaderMap { ... }
fn body(&self) -> RequestBody<&Self::Body> { ... }
}
Expand description
A RING API request.
Provided Associated Constants§
Required Associated Types§
Sourcetype Response: for<'de> Deserialize<'de>
type Response: for<'de> Deserialize<'de>
The “return type” of the request.
Required Methods§
Provided Methods§
Sourcefn body(&self) -> RequestBody<&Self::Body>
fn body(&self) -> RequestBody<&Self::Body>
The body of the request, if any
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.