OffchainFetcher

Trait OffchainFetcher 

Source
pub trait OffchainFetcher {
    // Provided methods
    fn fetch(request: HttpRequest) -> Result<Vec<u8>, &'static str> { ... }
    fn fetch_string(request: HttpRequest) -> Result<String, &'static str> { ... }
}
Expand description

A trait for fetching data with flexible HTTP requests.

Provided Methods§

Source

fn fetch(request: HttpRequest) -> Result<Vec<u8>, &'static str>

Send an HTTP request and return the response body.

Source

fn fetch_string(request: HttpRequest) -> Result<String, &'static str>

Send an HTTP request and return the response as a UTF-8 string.

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§