Skip to main content

Profile

Trait Profile 

Source
pub trait Profile: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn version(&self) -> &'static str;
    fn source_url(&self) -> &'static str;
    fn supported_types(&self) -> &[&str];
    fn evaluate_node(
        &self,
        node: &SchemaNode,
        vocab_diagnostics: &[ValidationDiagnostic],
    ) -> NodeProfileResult;
}
Expand description

A deployment profile adds platform-specific rules beyond Schema.org vocabulary validation.

Each profile defines which types it covers and how to evaluate nodes against its requirements (required fields, recommended fields, nested sub-requirements, etc.).

Required Methods§

Source

fn name(&self) -> &'static str

Profile identifier (e.g., "google").

Source

fn version(&self) -> &'static str

Profile version – date-based to track when rules were last verified against the platform’s documentation.

Source

fn source_url(&self) -> &'static str

Source documentation URL.

Source

fn supported_types(&self) -> &[&str]

Which Schema.org types does this profile cover?

The engine checks each node’s types against this list to decide whether to evaluate it.

Source

fn evaluate_node( &self, node: &SchemaNode, vocab_diagnostics: &[ValidationDiagnostic], ) -> NodeProfileResult

Evaluate a single node against this profile’s rules.

Called by the engine for each node whose type matches supported_types().

Implementors§