Trait ApiEndpoint

Source
pub trait ApiEndpoint<S> {
    // Required methods
    fn method(&self) -> Method;
    fn path(&self) -> &'static str;
    fn handler(&self) -> RouteHandler<S>;

    // Provided methods
    fn hidden(&self) -> bool { ... }
    fn stable(&self) -> bool { ... }
    fn operation(&self, _generator: &mut SchemaGenerator) -> Operation { ... }
}

Required Methods§

Source

fn method(&self) -> Method

Source

fn path(&self) -> &'static str

Source

fn handler(&self) -> RouteHandler<S>

Provided Methods§

Source

fn hidden(&self) -> bool

Source

fn stable(&self) -> bool

Indicates the stability of the API

Stable APIs are enabled in the REST service by default, unstable ones need to be explicitly configured to be enabled via config.

Both stable and unstable APIs have a badge, indicating the api’s stability, added to the top of the description field of their OpenAPI definition.

By default all apis are unstable, individual apis need to explicitly opt-in to being stable

Source

fn operation(&self, _generator: &mut SchemaGenerator) -> Operation

Implementors§