pub trait Validate: Sized {
// Required method
fn validate(
&self,
config: &ValidationConfig,
errors: &mut Vec<ValidationError>,
geometry: &Geometry,
);
// Provided method
fn validate_and_return_first_error(
&self,
geometry: &Geometry,
) -> Result<(), ValidationError> { ... }
}Expand description
Validate an object
This trait is used automatically when inserting an object into a store.
Required Methods§
Sourcefn validate(
&self,
config: &ValidationConfig,
errors: &mut Vec<ValidationError>,
geometry: &Geometry,
)
fn validate( &self, config: &ValidationConfig, errors: &mut Vec<ValidationError>, geometry: &Geometry, )
Validate the object
Provided Methods§
Sourcefn validate_and_return_first_error(
&self,
geometry: &Geometry,
) -> Result<(), ValidationError>
fn validate_and_return_first_error( &self, geometry: &Geometry, ) -> Result<(), ValidationError>
Validate the object using default config and return on first error
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".