Trait Endpoint

Source
pub trait Endpoint {
    // Required methods
    fn method(&self) -> Method;
    fn endpoint(&self) -> Cow<'static, str>;

    // Provided methods
    fn parameters(&self) -> QueryParams<'_> { ... }
    fn body(&self) -> Result<Option<(&'static str, Vec<u8>)>, BodyError> { ... }
}
Expand description

A trait for providing the necessary information for a single REST API endpoint.

Required Methods§

Source

fn method(&self) -> Method

The HTTP method to use for the endpoint.

Source

fn endpoint(&self) -> Cow<'static, str>

The path to the endpoint.

Provided Methods§

Source

fn parameters(&self) -> QueryParams<'_>

Query parameters for the endpoint.

Source

fn body(&self) -> Result<Option<(&'static str, Vec<u8>)>, BodyError>

The body for the endpoint.

Returns the Content-Encoding header for the data as well as the data itself.

§Errors

This method returns an error if the body could not be serialized to JSON.

Implementors§

Source§

impl Endpoint for Currencies

Source§

impl Endpoint for Timezones

Source§

impl<'a> Endpoint for Dividends<'a>

Source§

impl<'a> Endpoint for Eod<'a>

Source§

impl<'a> Endpoint for Exchanges<'a>

Source§

impl<'a> Endpoint for Intraday<'a>

Source§

impl<'a> Endpoint for Splits<'a>

Source§

impl<'a> Endpoint for Tickers<'a>