pub trait Component: Sealed + Sized {
const SECTION: Section;
// Required method
fn section(
openapi: &OpenAPI,
) -> Option<&IndexMap<String, ReferenceOr<Self>>>;
}Expand description
A type that $ref pointers can name.
Implemented for the nine #/components types and for PathItem. The
type is what decides which section is searched, so a pointer into a
different section is reported as
ResolveError::SectionMismatch
rather than silently missing.
Note that Callback is a transparent alias for
IndexMap<String, PathItem> rather than a distinct type, so any value of
that shape resolves as a callback. That is upstream’s design, not a choice
this crate can undo.
This trait is sealed: it cannot be implemented outside this crate. That
keeps Self::SECTION and Self::section in agreement, and it is what
makes the blanket impls on ReferenceOr<T> and ReferenceOr<Box<T>>
non-overlapping for good.
Required Associated Constants§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".