Skip to main content

Checker

Trait Checker 

Source
pub trait Checker: Send + Sync {
    // Required methods
    fn entity(&self) -> &str;
    fn check_and_fix(
        &self,
        ctx: &UserContext,
        record: &mut Record,
        location: &ObjectLocation,
        results: &mut CheckResults,
    );

    // Provided methods
    fn required(
        &self,
        record: &Record,
        field: &str,
        location: &ObjectLocation,
        results: &mut CheckResults,
    ) { ... }
    fn min_string_length(
        &self,
        record: &Record,
        field: &str,
        min_len: usize,
        location: &ObjectLocation,
        results: &mut CheckResults,
    ) { ... }
    fn max_string_length(
        &self,
        record: &Record,
        field: &str,
        max_len: usize,
        location: &ObjectLocation,
        results: &mut CheckResults,
    ) { ... }
}

Required Methods§

Source

fn entity(&self) -> &str

Source

fn check_and_fix( &self, ctx: &UserContext, record: &mut Record, location: &ObjectLocation, results: &mut CheckResults, )

Provided Methods§

Source

fn required( &self, record: &Record, field: &str, location: &ObjectLocation, results: &mut CheckResults, )

Source

fn min_string_length( &self, record: &Record, field: &str, min_len: usize, location: &ObjectLocation, results: &mut CheckResults, )

Source

fn max_string_length( &self, record: &Record, field: &str, max_len: usize, location: &ObjectLocation, results: &mut CheckResults, )

Implementors§

Source§

impl<T, C> Checker for TypedEntityChecker<T, C>
where T: Entity + Send + Sync, C: TypedChecker<T>,