TypesLoader

Trait TypesLoader 

Source
pub trait TypesLoader {
    // Required method
    async fn fetch_types(&self, uri: &Uri) -> Result<Types, TypesFetchError>;
}
Expand description

Type providing remote EIP712 type definitions from an URI.

A default implementation is provided for the () type that always return TypesFetchError::Unsupported.

Required Methods§

Source

async fn fetch_types(&self, uri: &Uri) -> Result<Types, TypesFetchError>

Fetches the type definitions located behind the given uri.

This is an asynchronous function returning a Self::Fetch future that resolves into ether the EIP712 Types or an error of type TypesFetchError.

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.

Implementations on Foreign Types§

Source§

impl TypesLoader for ()

Simple EIP712 loader implementation that always return TypesFetchError::Unsupported.

Source§

async fn fetch_types(&self, _uri: &Uri) -> Result<Types, TypesFetchError>

Source§

impl<T: TypesLoader> TypesLoader for &T

Source§

async fn fetch_types(&self, uri: &Uri) -> Result<Types, TypesFetchError>

Implementors§