Trait authzen_service_util::Endpoint
source · pub trait Endpoint {
type Params<'a>: Debug + Send + Serialize
where Self: 'a = ();
type Response<T> = DefaultResponse<T>;
const METHOD: Method;
// Required methods
fn path(&self) -> Path;
fn params(&self) -> Self::Params<'_>;
// Provided methods
fn headers(&self) -> HeaderMap { ... }
fn body(&self) -> Body { ... }
fn optional(self) -> Optional<Self>
where Self: Sized { ... }
fn ignore(self) -> Ignore<Self>
where Self: Sized { ... }
fn raw(self) -> Raw<Self>
where Self: Sized { ... }
fn paginated(self, pagination: impl Into<Option<Pagination>>) -> Paged<Self>
where Self: Sized { ... }
}
Provided Associated Types§
type Params<'a>: Debug + Send + Serialize where Self: 'a = ()
type Response<T> = DefaultResponse<T>
Required Associated Constants§
Required Methods§
Provided Methods§
fn headers(&self) -> HeaderMap
sourcefn body(&self) -> Body
fn body(&self) -> Body
body returns the opaque Body type because the actual body serialization may vary from endpoint to endpoint; e.g. one endpoint may want to use serde_json to serialize body data in json format while another may simply want to use the raw contents of a string as the bytes to be sent