pub struct ProfileRegistry { /* private fields */ }Expand description
A registry of available profiles for evaluation.
Create one with with_google() for Google Rich Results
profiles, or build a custom registry with new() and
register().
Implementations§
Source§impl ProfileRegistry
impl ProfileRegistry
Sourcepub fn with_google() -> Self
pub fn with_google() -> Self
Creates a registry with all built-in Google Rich Results profiles.
Sourcepub fn with_baseline() -> Self
pub fn with_baseline() -> Self
Creates a registry with the baseline Schema.org profile.
Sourcepub fn evaluate(
&self,
profile_name: &str,
graph: &StructuredDataGraph,
vocab_diagnostics: &[ValidationDiagnostic],
) -> Result<ProfileResult, ProfileError>
pub fn evaluate( &self, profile_name: &str, graph: &StructuredDataGraph, vocab_diagnostics: &[ValidationDiagnostic], ) -> Result<ProfileResult, ProfileError>
Evaluates a graph against all profiles with the given name.
Multiple profiles may share the same name (e.g., all Google profiles
are named "google"). This method runs all of them and merges results.
§Errors
Returns ProfileError::UnknownProfile if no profile with the given
name is registered.
Sourcepub fn profile_names(&self) -> Vec<&str>
pub fn profile_names(&self) -> Vec<&str>
Returns the names of all registered profiles.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProfileRegistry
impl !RefUnwindSafe for ProfileRegistry
impl Send for ProfileRegistry
impl Sync for ProfileRegistry
impl Unpin for ProfileRegistry
impl UnsafeUnpin for ProfileRegistry
impl !UnwindSafe for ProfileRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more