Request

Trait Request 

Source
pub trait Request: Serialize {
    type Response: DeserializeOwned;

    // Provided methods
    fn method() -> Option<&'static str> { ... }
    fn build_url<T: Display>(_: T) -> Option<String> { ... }
}
Expand description

Trait for convenient work with different types of requests and simultaneous connection with the response data type using the trait associated types

Required Associated Types§

Source

type Response: DeserializeOwned

Response type that can be deserialized with serde

Provided Methods§

Source

fn method() -> Option<&'static str>

Returns string query to API to invoke current request

Source

fn build_url<T: Display>(_: T) -> Option<String>

Builds a url with parameter for POST, PUT, DELETE requests

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§