Trait Resource

Source
pub trait Resource {
    type Context;
    type Body;

    // Required methods
    fn show(ctx: Self::Context) -> Self::Body;
    fn create(ctx: Self::Context) -> Self::Body;
    fn update(ctx: Self::Context) -> Self::Body;
    fn delete(ctx: Self::Context) -> Self::Body;
    fn edit(ctx: Self::Context) -> Self::Body;
    fn new(ctx: Self::Context) -> Self::Body;

    // Provided method
    fn build<'a>(
        opts: ResourceOptions,
    ) -> Vec<((&'a str, &'a str, &'a Method), fn(Self::Context) -> Self::Body)> { ... }
}

Required Associated Types§

Required Methods§

Source

fn show(ctx: Self::Context) -> Self::Body

Source

fn create(ctx: Self::Context) -> Self::Body

Source

fn update(ctx: Self::Context) -> Self::Body

Source

fn delete(ctx: Self::Context) -> Self::Body

Source

fn edit(ctx: Self::Context) -> Self::Body

Source

fn new(ctx: Self::Context) -> Self::Body

Provided Methods§

Source

fn build<'a>( opts: ResourceOptions, ) -> Vec<((&'a str, &'a str, &'a Method), fn(Self::Context) -> 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§