Skip to main content

Dependency

Trait Dependency 

Source
pub trait Dependency:
    Send
    + Sync
    + Sized
    + 'static {
    // Required method
    fn resolve(
        ctx: &mut ResolveContext<'_>,
    ) -> impl Future<Output = Result<Self, ApiError>> + Send;

    // Provided method
    fn describe(_op: &mut Operation, _registry: &mut SchemaRegistry) { ... }
}
Expand description

A type that can be built from a request and injected with Depends.

Required Methods§

Source

fn resolve( ctx: &mut ResolveContext<'_>, ) -> impl Future<Output = Result<Self, ApiError>> + Send

Build the value. Use ctx to read the request or resolve other dependencies.

Provided Methods§

Source

fn describe(_op: &mut Operation, _registry: &mut SchemaRegistry)

Document this dependency on op (parameters, security, …).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§