ConvertFrom

Trait ConvertFrom 

Source
pub trait ConvertFrom<T: Sized>
where Self: Sized,
{ // Required method fn convert_from(value: T) -> Option<Self>; }
Expand description

A trait for converting a value from one type to another. Any failure in converting will return None.

Required Methods§

Source

fn convert_from(value: T) -> Option<Self>

Convert value from one type to the other, returning None if conversion failed

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§