Trait RestClient

Source
pub trait RestClient {
    type Error: Error + Send + Sync + 'static;

    // Required methods
    fn rest_endpoint(
        &self,
        endpoint: &str,
    ) -> Result<Url, ApiError<Self::Error>>;
    fn has_api_key(&self) -> bool;
}
Expand description

A trait representing a client which can communicate with speedrun.com via REST

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

The error that may occur for this client

Required Methods§

Source

fn rest_endpoint(&self, endpoint: &str) -> Result<Url, ApiError<Self::Error>>

Get the URL for the endpoint for the client.

This method adds the hostname for the target api.

Source

fn has_api_key(&self) -> bool

If the client has an API key

Implementors§