Skip to main content

ValidateString

Trait ValidateString 

Source
pub trait ValidateString {
    type Error: Debug;

    // Required method
    fn validate(value: &str) -> Result<(), Self::Error>;
}
Expand description

Defines validation rules for a &str.

Implement this trait to created a new ValidatedConstantString type, which enforces the rules defined in ValidateString::validate. See ValidatedConstantString for more detail.

Required Associated Types§

Required Methods§

Source

fn validate(value: &str) -> Result<(), Self::Error>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§