Skip to main content

ResolveWithOpenAPI

Trait ResolveWithOpenAPI 

Source
pub trait ResolveWithOpenAPI<T> {
    // Required method
    fn resolve<'a>(
        &'a self,
        openapi: &'a OpenAPI,
    ) -> Result<&'a T, ResolveError>;
}
Expand description

Resolves a ReferenceOr<T> (or its boxed variant) to the item it denotes.

Required Methods§

Source

fn resolve<'a>(&'a self, openapi: &'a OpenAPI) -> Result<&'a T, ResolveError>

Returns the inline item, or the item the $ref points at.

The result borrows from whichever of the two arguments it came from, so its lifetime is the shorter of them: resolving out of a temporary ReferenceOr yields a borrow that cannot outlive that temporary, even when the value in fact came from openapi.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T: Component> ResolveWithOpenAPI<T> for ReferenceOr<Box<T>>

Source§

fn resolve<'a>(&'a self, openapi: &'a OpenAPI) -> Result<&'a T, ResolveError>

Source§

impl<T: Component> ResolveWithOpenAPI<T> for ReferenceOr<T>

Source§

fn resolve<'a>(&'a self, openapi: &'a OpenAPI) -> Result<&'a T, ResolveError>

Implementors§