Skip to main content

ValueConverter

Trait ValueConverter 

Source
pub trait ValueConverter: Send + Sync {
    // Required methods
    fn convert(&self, value: &str) -> Result<String, ConversionError>;
    fn convert_back(&self, value: &str) -> Result<String, ConversionError>;
}
Expand description

Converts values between different types for binding.

Required Methods§

Source

fn convert(&self, value: &str) -> Result<String, ConversionError>

Convert from source type to target type.

Source

fn convert_back(&self, value: &str) -> Result<String, ConversionError>

Convert back from target type to source type.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§