pub trait Validate {
// Required method
fn validate(&self) -> Vec<ValidationIssue>;
// Provided method
fn is_valid(&self) -> bool { ... }
}Expand description
Types that can validate themselves against FHIR constraints.
Required Methods§
Sourcefn validate(&self) -> Vec<ValidationIssue>
fn validate(&self) -> Vec<ValidationIssue>
Return all validation issues; an empty vector means the value is valid.
Provided Methods§
Sourcefn is_valid(&self) -> bool
fn is_valid(&self) -> bool
Convenience: true when Validate::validate finds no issues.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl Validate for String
A bare String (used by a few fields) carries no FHIR-level constraint here.
impl Validate for String
A bare String (used by a few fields) carries no FHIR-level constraint here.
fn validate(&self) -> Vec<ValidationIssue>
Source§impl Validate for Value
Arbitrary embedded JSON (e.g. a contained resource) is not structurally
validated here.
impl Validate for Value
Arbitrary embedded JSON (e.g. a contained resource) is not structurally
validated here.
fn validate(&self) -> Vec<ValidationIssue>
Source§impl<T: ?Sized> Validate for PhantomData<T>
A zero-sized type marker (e.g. the phantom on Reference<T>) has nothing to
validate.
impl<T: ?Sized> Validate for PhantomData<T>
A zero-sized type marker (e.g. the phantom on Reference<T>) has nothing to
validate.
fn validate(&self) -> Vec<ValidationIssue>
Source§impl<T: Validate> Validate for Vec1<T>
A non-empty Vec1 (used for FHIR 1..* elements) validates each element.
impl<T: Validate> Validate for Vec1<T>
A non-empty Vec1 (used for FHIR 1..* elements) validates each element.