pub struct PatternValidator;Expand description
Validates that a Pattern is well-formed and likely to produce correct
transformations.
Implementations§
Source§impl PatternValidator
impl PatternValidator
Sourcepub fn validate(pattern: &Pattern) -> Result<ValidationResult>
pub fn validate(pattern: &Pattern) -> Result<ValidationResult>
Validate a pattern and return a ValidationResult.
§Checks performed
| Check | Severity |
|---|---|
before_template is non-empty | error |
after_template is non-empty | error |
language is non-empty | error |
All variables appear in before_template | error |
All variables appear in after_template | warning |
| Confidence >= 0.3 | warning |
| Confidence >= 0.1 | error |
before_template != after_template | warning |
Auto Trait Implementations§
impl Freeze for PatternValidator
impl RefUnwindSafe for PatternValidator
impl Send for PatternValidator
impl Sync for PatternValidator
impl Unpin for PatternValidator
impl UnsafeUnpin for PatternValidator
impl UnwindSafe for PatternValidator
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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