Trait OptionLayerExt

Source
pub trait OptionLayerExt<S> {
    // Required method
    fn optional<T>(
        self,
        middleware: Option<T>,
    ) -> ServiceBuilder<Stack<OptionLayer<T>, S>>;
}
Expand description

Extends ServiceBuilder with an optional method.

Required Methods§

Source

fn optional<T>( self, middleware: Option<T>, ) -> ServiceBuilder<Stack<OptionLayer<T>, S>>

Apply an optional middleware to the service, with a consistent concrete error type.

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§