pub struct Validator<'set> { /* private fields */ }Expand description
Validates R4 resources against the profiles of a package set.
Implementations§
Source§impl<'set> Validator<'set>
impl<'set> Validator<'set>
Sourcepub fn new(set: &'set PackageSet) -> Self
pub fn new(set: &'set PackageSet) -> Self
Creates a validator over set.
Sourcepub fn validate(&self, resource: &Value) -> Result<Report, ValidateError>
pub fn validate(&self, resource: &Value) -> Result<Report, ValidateError>
Validates resource against the core definition of its type.
Each profile the resource claims in meta.profile is listed as
unevaluated.
§Errors
Returns ValidateError when a definition the validation reaches does
not resolve, carries no snapshot, or cannot be read.
Sourcepub fn validate_against(
&self,
resource: &Value,
profile: &str,
) -> Result<Report, ValidateError>
pub fn validate_against( &self, resource: &Value, profile: &str, ) -> Result<Report, ValidateError>
Validates resource against the profile profile names, a canonical
with an optional |version.
§Errors
Returns ValidateError when the profile or a definition the
validation reaches does not resolve, carries no snapshot, or cannot be
read.
Trait Implementations§
Auto Trait Implementations§
impl<'set> !Freeze for Validator<'set>
impl<'set> !RefUnwindSafe for Validator<'set>
impl<'set> !UnwindSafe for Validator<'set>
impl<'set> Send for Validator<'set>
impl<'set> Sync for Validator<'set>
impl<'set> Unpin for Validator<'set>
impl<'set> UnsafeUnpin for Validator<'set>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
Source§fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
Invokes
WrappingSpan::make_wrapped to wrap an AST node in a span.