pub trait ResolveOptionalWithOpenAPI<T> {
// Required method
fn resolve_optional<'a>(
&'a self,
openapi: &'a OpenAPI,
) -> Result<Option<&'a T>, ResolveError>;
}Expand description
Resolves an optional ReferenceOr<T> field.
Kept separate from ResolveWithOpenAPI so that an absent field — which
is valid — stays distinguishable from a broken reference.
Required Methods§
Sourcefn resolve_optional<'a>(
&'a self,
openapi: &'a OpenAPI,
) -> Result<Option<&'a T>, ResolveError>
fn resolve_optional<'a>( &'a self, openapi: &'a OpenAPI, ) -> Result<Option<&'a T>, ResolveError>
Returns Ok(None) if the field is absent, and an error only if a
reference that is present cannot be resolved.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".