pub trait TypeRenderable {
    type Get;
    type Post;
    type Put;

    // Provided methods
    fn get(&mut self) -> Result<Self::Get, u8> { ... }
    fn post(&mut self, _representation: &Self::Post) -> u8 { ... }
    fn put(&mut self, _representation: &Self::Put) -> u8 { ... }
    fn delete(&mut self) -> u8 { ... }
}
Expand description

A simple Handler trait that supports GET, POST and/or PUT on a data structure that supports serde.

A TypeRenderable implementation can be turned into a Handler by wrapping it in TypeHandler::new.

Required Associated Types§

Provided Methods§

source

fn get(&mut self) -> Result<Self::Get, u8>

source

fn post(&mut self, _representation: &Self::Post) -> u8

source

fn put(&mut self, _representation: &Self::Put) -> u8

source

fn delete(&mut self) -> u8

Implementors§