pub trait ContractFamily:
Send
+ Sync
+ Sized
+ 'static {
type Category: EntityCategory;
type LinkExtractor: LinkExtractor<Family = Self> + Send + Sync;
type CompanionStrategy: CompanionStrategy + Send + Sync;
Show 15 methods
// Required methods
fn name(&self) -> &'static str;
fn fence_language(&self) -> &'static str;
fn default_title(&self) -> &'static str;
fn default_markdown_root(&self) -> &'static str;
fn extensions(&self) -> &'static [&'static str];
fn companion_strategy(&self) -> &Self::CompanionStrategy;
fn category_names(&self) -> &'static [&'static str];
fn detect_version(&self, raw: &RawDoc) -> Option<SpecVersion>;
fn supported_versions(&self) -> &'static [SupportedVersion];
fn link_extractor(&self) -> &Self::LinkExtractor;
// Provided methods
fn companion_extensions(&self) -> &'static [&'static str] { ... }
fn meta_schema(&self, version: &SpecVersion) -> Option<&'static [u8]> { ... }
fn supported_protocols(&self) -> &'static [&'static str] { ... }
fn default_protocol(&self) -> &'static str { ... }
fn extra_option_tokens(&self) -> &'static [&'static str] { ... }
}Expand description
Identity and capability metadata for one contract family.
Each parser crate provides a zero-sized or lightweight implementor describing OpenAPI, Protobuf, AsyncAPI, etc. Associated types wire up family-specific link extraction and companion discovery.
Required Associated Types§
Sourcetype Category: EntityCategory
type Category: EntityCategory
Entity category enum or newtype for this family.
Sourcetype LinkExtractor: LinkExtractor<Family = Self> + Send + Sync
type LinkExtractor: LinkExtractor<Family = Self> + Send + Sync
Family-specific LinkExtractor implementation.
Sourcetype CompanionStrategy: CompanionStrategy + Send + Sync
type CompanionStrategy: CompanionStrategy + Send + Sync
Family-specific CompanionStrategy implementation.
Required Methods§
Sourcefn fence_language(&self) -> &'static str
fn fence_language(&self) -> &'static str
Default fenced-code language tag for this family’s entities.
Sourcefn default_title(&self) -> &'static str
fn default_title(&self) -> &'static str
Default manual title when the input does not specify one.
Sourcefn default_markdown_root(&self) -> &'static str
fn default_markdown_root(&self) -> &'static str
Default markdown output root relative to the book root.
Sourcefn extensions(&self) -> &'static [&'static str]
fn extensions(&self) -> &'static [&'static str]
Filename extensions recognized for contract inputs (e.g. ["yaml", "yml"]).
Sourcefn companion_strategy(&self) -> &Self::CompanionStrategy
fn companion_strategy(&self) -> &Self::CompanionStrategy
Returns the companion discovery strategy for this family.
Sourcefn category_names(&self) -> &'static [&'static str]
fn category_names(&self) -> &'static [&'static str]
All category slug strings this family emits.
Sourcefn detect_version(&self, raw: &RawDoc) -> Option<SpecVersion>
fn detect_version(&self, raw: &RawDoc) -> Option<SpecVersion>
Detects the spec version from raw bytes, when possible.
Sourcefn supported_versions(&self) -> &'static [SupportedVersion]
fn supported_versions(&self) -> &'static [SupportedVersion]
Supported spec versions and their lifecycle status.
Sourcefn link_extractor(&self) -> &Self::LinkExtractor
fn link_extractor(&self) -> &Self::LinkExtractor
Returns the link extractor instance for this family.
Provided Methods§
Sourcefn companion_extensions(&self) -> &'static [&'static str]
fn companion_extensions(&self) -> &'static [&'static str]
Filename extensions searched for companion documents.
Defaults to Self::extensions when companions share input extensions.
Sourcefn meta_schema(&self, version: &SpecVersion) -> Option<&'static [u8]>
fn meta_schema(&self, version: &SpecVersion) -> Option<&'static [u8]>
Returns optional meta-schema bytes for validation at version, when available.
Sourcefn supported_protocols(&self) -> &'static [&'static str]
fn supported_protocols(&self) -> &'static [&'static str]
Protocol slugs this family may attach during populate.
Sourcefn default_protocol(&self) -> &'static str
fn default_protocol(&self) -> &'static str
Default protocol slug for this family when populate attaches one binding.
Sourcefn extra_option_tokens(&self) -> &'static [&'static str]
fn extra_option_tokens(&self) -> &'static [&'static str]
Additional CLI or config option tokens understood by this family’s tooling.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".