Trait Fetch

Source
pub trait Fetch:
    Clone
    + Send
    + Sync
    + 'static {
    type Result: Future<Item = Response, Error = Error> + Send + 'static;

    // Required methods
    fn fetch(&self, request: Request, abort: Abort) -> Self::Result;
    fn get(&self, url: &str, abort: Abort) -> Self::Result;
    fn post(&self, url: &str, abort: Abort) -> Self::Result;
}
Expand description

Types which retrieve content from some URL.

Required Associated Types§

Source

type Result: Future<Item = Response, Error = Error> + Send + 'static

The result future.

Required Methods§

Source

fn fetch(&self, request: Request, abort: Abort) -> Self::Result

Make a request to given URL

Source

fn get(&self, url: &str, abort: Abort) -> Self::Result

Get content from some URL.

Source

fn post(&self, url: &str, abort: Abort) -> Self::Result

Post content to some URL.

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§

Source§

impl Fetch for Client

Source§

type Result = Box<dyn Future<Error = Error, Item = Response> + Send>