pub trait SimklRequest {
// Required method
fn endpoint(&self) -> String;
// Provided methods
fn method(&self) -> HttpMethod { ... }
fn query_params(&self) -> Vec<(String, String)> { ... }
fn headers(&self) -> Vec<(String, String)> { ... }
fn build_url(&self) -> String { ... }
}Expand description
A URL-and-query-parameter description for a Simkl API endpoint.
This trait models GET endpoints — the ones whose entire request is
captured by URL + query string. POST endpoints with a JSON body (checkin,
sync/history, sync/ratings, sync/add-to-list) do not implement this
trait; their payload types are serialised directly via serde_json.
Required Methods§
Provided Methods§
Sourcefn method(&self) -> HttpMethod
fn method(&self) -> HttpMethod
HTTP verb; defaults to GET.
Sourcefn query_params(&self) -> Vec<(String, String)>
fn query_params(&self) -> Vec<(String, String)>
Query-string key/value pairs. Values are URL-encoded in [build_url].
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".