Skip to main content

Converter

Trait Converter 

Source
pub trait Converter<Input, Output> {
    // Required method
    fn convert(&self, value: Input) -> Output;

    // Provided method
    fn batch_convert(&self, values: &[Input]) -> Vec<Output>
       where Input: Clone { ... }
}

Required Methods§

Source

fn convert(&self, value: Input) -> Output

Provided Methods§

Source

fn batch_convert(&self, values: &[Input]) -> Vec<Output>
where Input: Clone,

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<Input, Output, T> Converter<Input, Output> for &T
where T: Converter<Input, Output>,

Source§

fn convert(&self, value: Input) -> Output

Implementors§