Skip to main content

Client

Trait Client 

Source
pub trait Client<P>
where P: Params, Self: Default,
{ type Response: for<'de> Deserialize<'de> + Serialize + Clone + DebugImpl + PartialEq; const BASE_URL: &'static str; // Required method fn get(&self, params: P) -> Result<Self::Response, Box<dyn Error>>; }
Expand description

Interface behavior for all clients

Required Associated Constants§

Source

const BASE_URL: &'static str

The base URL endpoint

Required Associated Types§

Source

type Response: for<'de> Deserialize<'de> + Serialize + Clone + DebugImpl + PartialEq

The response type

Required Methods§

Source

fn get(&self, params: P) -> Result<Self::Response, Box<dyn Error>>

Get the response from the API

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'p, DEP> Client<DEP> for RBE
where DEP: Params,

Source§

const BASE_URL: &'static str = "https://api.nasa.gov/DONKI/RBE"

Source§

type Response = Value

Source§

impl<'p, P> Client<P> for EPIC
where P: Params,

Source§

const BASE_URL: &'static str = "https://api.nasa.gov/EPIC/api"

Source§

type Response = Value

Source§

impl<'p, PARA> Client<PARA> for Earth
where PARA: Params,

Source§

const BASE_URL: &'static str = "https://api.nasa.gov/planetary/earth/imagery"

Source§

type Response = Value

Source§

impl<'p, PARAMS> Client<PARAMS> for Apod
where PARAMS: Params,

Source§

const BASE_URL: &'static str = "https://api.nasa.gov/planetary/apod"

Source§

type Response = Value

Source§

impl<'p, PARAMS> Client<PARAMS> for CME
where PARAMS: Params,

Source§

const BASE_URL: &'static str = "https://api.nasa.gov/DONKI/CME"

Source§

type Response = Value

Source§

impl<'p, PARAMS> Client<PARAMS> for FLR
where PARAMS: Params,

Source§

const BASE_URL: &'static str = "https://api.nasa.gov/DONKI/FLR"

Source§

type Response = Value

Source§

impl<'p, PARAMS> Client<PARAMS> for GST
where PARAMS: Params,

Source§

const BASE_URL: &'static str = "https://api.nasa.gov/DONKI/GST"

Source§

type Response = Value

Source§

impl<'p, PARAMS> Client<PARAMS> for ISP
where PARAMS: Params,

Source§

const BASE_URL: &'static str = "https://api.nasa.gov/DONKI/IPS"

Source§

type Response = Value

Source§

impl<'p, PARAMS> Client<PARAMS> for SEP
where PARAMS: Params,

Source§

const BASE_URL: &'static str = "https://api.nasa.gov/DONKI/SEP"

Source§

type Response = Value

Source§

impl<'p, PARAMS> Client<PARAMS> for NeoFeed
where PARAMS: Params,

Source§

const BASE_URL: &'static str = "https://api.nasa.gov/neo/rest/v1/feed"

Source§

type Response = Value

Source§

impl<'p, PARAMS> Client<PARAMS> for NeoLookup
where PARAMS: Params,

Source§

const BASE_URL: &'static str = "https://api.nasa.gov/neo/rest/v1/neo"

Source§

type Response = Value