Skip to main content

FieldValidator

Trait FieldValidator 

Source
trait FieldValidator {
    // Required method
    fn is_empty(&self) -> bool;
}
Expand description

Trait for checking if a field is effectively empty.

is_empty(): Checks if the field has no meaningful value

  • Used when backend is enabled to validate required fields
  • None, Some(""), false, or "" are considered empty

Required Methods§

Source

fn is_empty(&self) -> bool

Check if the field is empty (has no meaningful value).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl FieldValidator for Option<SecretString>

Option fields: None or empty secret is empty For secrets, Some(“”) is treated as “not provided” for both checks

Source§

fn is_empty(&self) -> bool

Source§

impl FieldValidator for Option<String>

Option fields: None or empty content is empty

Source§

fn is_empty(&self) -> bool

Source§

impl FieldValidator for String

String fields: empty if the string is empty

Source§

fn is_empty(&self) -> bool

Source§

impl FieldValidator for bool

Bool fields: false is considered “empty”, true is “provided”

Source§

fn is_empty(&self) -> bool

Implementors§