Trait Endpoint

Source
pub trait Endpoint {
    type Request: Serialize;
    type Response: for<'de> Deserialize<'de>;

    // Required method
    fn endpoint(&self) -> String;

    // Provided method
    fn validate_response(_response: &Self::Response) -> Result<(), ApiError> { ... }
}

Required Associated Types§

Required Methods§

Source

fn endpoint(&self) -> String

Provided Methods§

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§