Request

Trait Request 

Source
pub trait Request {
    type Body: Serialize + Debug;
    type Response: DeserializeOwned + Default;

    const METHOD: Method;

    // Required method
    fn endpoint(&self) -> Cow<'_, str>;

    // Provided methods
    fn headers(&self) -> HashMap<String, String> { ... }
    fn body(&self) -> Option<Self::Body> { ... }
}
Expand description

This trait is the generic implementation for every request we make to the Firefly III API, you can set the Body to () in case the request does not send a body. Responses are in the response module.

Required Associated Constants§

Source

const METHOD: Method

Required Associated Types§

Required Methods§

Source

fn endpoint(&self) -> Cow<'_, str>

Provided Methods§

Source

fn headers(&self) -> HashMap<String, String>

Source

fn body(&self) -> Option<Self::Body>

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 Request for firefly_iii_rust::account::Create

Source§

const METHOD: Method = Method::Post

Source§

type Body = Create

Source§

type Response = Response<Data>

Source§

impl Request for firefly_iii_rust::account::Delete

Source§

const METHOD: Method = Method::Delete

Source§

type Body = ()

Source§

type Response = EmptyResponse

Source§

impl Request for firefly_iii_rust::account::Get

Source§

const METHOD: Method = Method::Get

Source§

type Body = ()

Source§

type Response = Response<Data>

Source§

impl Request for firefly_iii_rust::account::List

Source§

const METHOD: Method = Method::Get

Source§

type Body = ()

Source§

type Response = PaginatedResponse<Vec<Data>>

Source§

impl Request for firefly_iii_rust::transaction::Create

Source§

const METHOD: Method = Method::Post

Source§

type Body = Create

Source§

type Response = Response<Data>

Source§

impl Request for firefly_iii_rust::transaction::Delete

Source§

const METHOD: Method = Method::Delete

Source§

type Body = ()

Source§

type Response = EmptyResponse

Source§

impl Request for firefly_iii_rust::transaction::Get

Source§

const METHOD: Method = Method::Get

Source§

type Body = ()

Source§

type Response = Response<Data>

Source§

impl Request for firefly_iii_rust::transaction::List

Source§

const METHOD: Method = Method::Get

Source§

type Body = ()

Source§

type Response = PaginatedResponse<Vec<Data>>