pub trait SimpleCBORHandler {
    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 { ... }
}
Expand description

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

A SimpleCBORHandler implementation can be turned into a Handler by wrapping it in SimpleWrapper::new.

The type a misnomer that can’t be fixed until trait aliases are stabilized: It doesn’t need to turn into CBOR, just something the Simple…Wrapper can (de)serialize.

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

Implementors§