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§
fn run<T: Serialize>(&self, cmd: &mut Request<T>) -> Result<Self::Response>
sourcefn api_max_pages<T: Serialize>(&self, cmd: &Request<T>) -> u32
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§
sourcefn throttle(&self, milliseconds: Milliseconds)
fn throttle(&self, milliseconds: Milliseconds)
Milliseconds to wait before executing the next request
Object Safety§
This trait is not object safe.