Skip to main content

APIEndpointTrait

Trait APIEndpointTrait 

Source
pub trait APIEndpointTrait {
    // Required methods
    fn default_groups(&self) -> Option<Vec<Group>>;
    fn default_params(&self) -> Option<Vec<Param<'_>>>;
    fn url(&self, unit: &Unit) -> String;
}
Expand description

Trait that defines all required methods for API endpoint URL construction (prior to adding non-default parameters). This is useful for defining custom API endpoints that are not included with the crate.

Required Methods§

Source

fn default_groups(&self) -> Option<Vec<Group>>

Returns a vector of default groups to apply to match the pre-defined schemas.

Note: If there are no default groups defined the None variant is returned.

Source

fn default_params(&self) -> Option<Vec<Param<'_>>>

Returns a vector of default API endpoint parameters to apply to match the pre-defined schemas.

Note: If there are no default parameters defined the None variant is returned.

Source

fn url(&self, unit: &Unit) -> String

Produces URL for a given API endpoint.

§Input
  • unit: Unit of the interval between successive data points

Implementors§