Trait ft_sdk::Layout

source ·
pub trait Layout {
    type Error: Debug + From<Error>;

    // Required methods
    fn from_in(in_: In, ty: RequestType) -> Result<Self, Self::Error>
       where Self: Sized;
    fn json(&mut self, o: Value) -> Result<Value, Self::Error>;
    fn render_error(e: Self::Error) -> Response<Bytes>;

    // Provided methods
    fn _page<P>(r: Request<Bytes>) -> Result<Response<Bytes>, Self::Error>
       where P: Page<Self, Self::Error> + Serialize,
             Self: Sized { ... }
    fn page<P>(r: Request<Bytes>) -> Response<Bytes>
       where P: Page<Self, Self::Error> + Serialize,
             Self: Sized { ... }
    fn action<A>(r: Request<Bytes>) -> Response<Bytes>
       where A: Action<Self, Self::Error>,
             Self: Sized { ... }
    fn _action<A>(r: Request<Bytes>) -> Result<Response<Bytes>, Self::Error>
       where A: Action<Self, Self::Error>,
             Self: Sized { ... }
}

Required Associated Types§

Required Methods§

source

fn from_in(in_: In, ty: RequestType) -> Result<Self, Self::Error>
where Self: Sized,

source

fn json(&mut self, o: Value) -> Result<Value, Self::Error>

source

fn render_error(e: Self::Error) -> Response<Bytes>

Provided Methods§

source

fn _page<P>(r: Request<Bytes>) -> Result<Response<Bytes>, Self::Error>
where P: Page<Self, Self::Error> + Serialize, Self: Sized,

source

fn page<P>(r: Request<Bytes>) -> Response<Bytes>
where P: Page<Self, Self::Error> + Serialize, Self: Sized,

source

fn action<A>(r: Request<Bytes>) -> Response<Bytes>
where A: Action<Self, Self::Error>, Self: Sized,

source

fn _action<A>(r: Request<Bytes>) -> Result<Response<Bytes>, Self::Error>
where A: Action<Self, Self::Error>, Self: Sized,

Object Safety§

This trait is not object safe.

Implementors§