Skip to main content

Transform

Trait Transform 

Source
pub trait Transform<T>: Send + Sync {
    // Required methods
    fn transform(&self, value: T) -> T;
    fn name(&self) -> &'static str;
}
Expand description

Trait for field transformations.

Transformations modify values during validation (e.g., trim, uppercase).

Required Methods§

Source

fn transform(&self, value: T) -> T

Transform the value.

Source

fn name(&self) -> &'static str

Get the transformation name.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Transform<String> for CapitalizeTransform

Source§

fn transform(&self, value: String) -> String

Source§

fn name(&self) -> &'static str

Source§

impl Transform<String> for CollapseWhitespaceTransform

Source§

fn transform(&self, value: String) -> String

Source§

fn name(&self) -> &'static str

Source§

impl Transform<String> for LowercaseTransform

Source§

fn transform(&self, value: String) -> String

Source§

fn name(&self) -> &'static str

Source§

impl Transform<String> for TrimEndTransform

Source§

fn transform(&self, value: String) -> String

Source§

fn name(&self) -> &'static str

Source§

impl Transform<String> for TrimStartTransform

Source§

fn transform(&self, value: String) -> String

Source§

fn name(&self) -> &'static str

Source§

impl Transform<String> for TrimTransform

Source§

fn transform(&self, value: String) -> String

Source§

fn name(&self) -> &'static str

Source§

impl Transform<String> for UppercaseTransform

Source§

fn transform(&self, value: String) -> String

Source§

fn name(&self) -> &'static str

Implementors§