Trait ConvertUtils

Source
pub trait ConvertUtils: Sized {
    // Required methods
    fn to<T: TryFrom<Self>>(self) -> Option<T>;
    fn to_or<T: TryFrom<Self>>(self, fallback: T) -> T;
    fn to_result<T: TryFrom<Self>>(self) -> Result<T, T::Error>;
}

Required Methods§

Source

fn to<T: TryFrom<Self>>(self) -> Option<T>

Source

fn to_or<T: TryFrom<Self>>(self, fallback: T) -> T

Source

fn to_result<T: TryFrom<Self>>(self) -> Result<T, T::Error>

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§

Source§

impl<T> ConvertUtils for T