Trait gr::io::HttpRunner

source ·
pub trait HttpRunner {
    type Response;

    // Required methods
    fn run<T: Serialize>(&self, cmd: &mut Request<T>) -> Result<Self::Response>;
    fn api_max_pages<T: Serialize>(&self, cmd: &Request<T>) -> u32;

    // Provided method
    fn throttle(&self, milliseconds: Milliseconds) { ... }
}
Expand description

A trait for the HTTP protocol. Implementors need to conform with the HTTP constraints and requirements. Implementors accept a Request that wraps headers, payloads and HTTP methods. Clients can potentially do HTTP calls against a remote server or mock the responses for testing purposes.

Required Associated Types§

Required Methods§

source

fn run<T: Serialize>(&self, cmd: &mut Request<T>) -> Result<Self::Response>

source

fn api_max_pages<T: Serialize>(&self, cmd: &Request<T>) -> u32

Return the number of API MAX PAGES allowed for the given Request.

Provided Methods§

source

fn throttle(&self, milliseconds: Milliseconds)

Milliseconds to wait before executing the next request

Object Safety§

This trait is not object safe.

Implementors§