Skip to main content

Endpoint

Trait Endpoint 

Source
pub trait Endpoint {
    type Output;

    // Required methods
    fn method(&self) -> &'static str;
    fn path(&self) -> String;

    // Provided methods
    fn query(&self) -> Vec<(String, String)> { ... }
    fn body(&self) -> Option<Value> { ... }
}
Expand description

Generic description of a ROMM API endpoint.

Required Associated Types§

Required Methods§

Source

fn method(&self) -> &'static str

HTTP method, e.g. “GET”, “POST”.

Source

fn path(&self) -> String

Path relative to the base URL, e.g. “/api/roms”.

Provided Methods§

Source

fn query(&self) -> Vec<(String, String)>

Query parameters as key/value pairs.

Source

fn body(&self) -> Option<Value>

Optional JSON request body.

Implementors§