Skip to main content

TryNew

Trait TryNew 

Source
pub trait TryNew: Sized {
    type ValueType;
    type Error;

    // Required methods
    fn try_new(value: Self::ValueType) -> Result<Self, Self::Error>;
    fn new(value: Self::ValueType) -> Self;
}

Required Associated Types§

Required Methods§

Source

fn try_new(value: Self::ValueType) -> Result<Self, Self::Error>

Source

fn new(value: Self::ValueType) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl TryNew for Complex<f64>

Source§

type ValueType = Complex<f64>

Source§

type Error = ComplexValueErrors<f64, Complex<f64>>

Source§

fn try_new(value: Self::ValueType) -> Result<Self, Self::Error>

Source§

fn new(value: Self::ValueType) -> Self

Source§

impl TryNew for f64

Source§

type ValueType = f64

Source§

type Error = RealValueErrors<f64>

Source§

fn try_new(value: Self::ValueType) -> Result<Self, Self::Error>

Source§

fn new(value: Self::ValueType) -> Self

Implementors§