Struct ConstraintEngine

Source
pub struct ConstraintEngine { /* private fields */ }
Expand description

Core constraint validation engine

Implementations§

Source§

impl ConstraintEngine

Source

pub fn new() -> Self

Create a new constraint engine

Source

pub fn process_constraints( &mut self, item: &ContentItem, context: &ValidationContext<'_>, ) -> Result<(ContentItem, Vec<ValidationFailure>), BuildError>

Process all constraints for a given content item

Source

pub fn process_constraints_mut( &mut self, item: &mut ContentItem, context: &ValidationContext<'_>, ) -> Result<Vec<ValidationFailure>, BuildError>

Process all constraints for a given content item (mutable version)

Source

pub fn validate_constraint( &mut self, rule: &ValidationRule, item: &ContentItem, ) -> Result<ValidationResult, BuildError>

Validate a single constraint expression against an item

Trait Implementations§

Source§

impl ConstraintValidator for ConstraintEngine

Source§

fn validate_constraint( &self, _rule: &ValidationRule, _item: &ContentItem, ) -> ValidationResult

Validate a specific constraint rule against a content item
Source§

fn apply_actions( &self, _failures: &[ValidationFailure], actions: &ConstraintActions, ) -> ActionResult

Apply actions based on validation failures
Source§

impl Default for ConstraintEngine

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Validator for ConstraintEngine

Source§

fn validate(&self, _context: &ValidationContext<'_>) -> ValidationResult

Validate content against rules
Source§

fn get_validation_rules(&self) -> Vec<ValidationRule>

Get validation rules supported by this validator
Source§

fn get_severity(&self) -> ValidationSeverity

Get the severity level for this validator
Source§

fn supports_incremental(&self) -> bool

Whether this validator supports incremental validation

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.