pub trait Rest:
Send
+ Sync
+ 'static {
// Required methods
fn method(&self, endpoint: &RestEndpoint) -> Result<Method, RestError>;
fn to_path(&self, endpoint: &RestEndpoint) -> Result<String, RestError>;
fn to_payload(&self) -> Payload;
// Provided methods
fn add_headers(
&self,
_endpoint: &RestEndpoint,
_headers: &mut HeaderMap,
) -> Result<(), RestError> { ... }
fn need_apikey(&self) -> bool { ... }
fn need_sign(&self) -> bool { ... }
fn serialize(&self, _endpoint: &RestEndpoint) -> Result<Value, RestError> { ... }
}Expand description
Rest payload.
Required Methods§
Sourcefn to_payload(&self) -> Payload
fn to_payload(&self) -> Payload
Clone.
Provided Methods§
Sourcefn add_headers(
&self,
_endpoint: &RestEndpoint,
_headers: &mut HeaderMap,
) -> Result<(), RestError>
fn add_headers( &self, _endpoint: &RestEndpoint, _headers: &mut HeaderMap, ) -> Result<(), RestError>
add request header.
Sourcefn need_apikey(&self) -> bool
fn need_apikey(&self) -> bool
Whether need apikey.