HttpRunner

Trait 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;
}
Expand description

A trait for the HTTP protocol. Implementers need to conform with the HTTP constraints and requirements. Implementers 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§