pub trait Api {
type Reply;
type Body: Read;
type Error;
// Required methods
fn method(&self) -> Method;
fn path(&self) -> String;
fn query(&self) -> Query<'_>;
fn headers(&self) -> Headers;
fn body(&self) -> Self::Body;
fn parse<Resp>(&self, _: &mut Resp) -> Result<Self::Reply, Self::Error>
where Resp: HttpResponse;
}
Expand description
Api
represents a HTTP API exposing all the request parameters
and a function to parse the HTTP response.
Required Associated Types§
Required Methods§
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.