Trait New

Source
pub trait New {
    type Config: Clone;

    // Required method
    fn new(config: &Self::Config) -> Self;
}
Expand description

New instances are instantiable given a specified input of <Self as New>::Config.

Required Associated Types§

Source

type Config: Clone

The type of data required to instantiate a new Self.

Required Methods§

Source

fn new(config: &Self::Config) -> Self

Instantiate a new Self with the given <Self as New>::Config.

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.

Implementations on Foreign Types§

Source§

impl New for u8

Source§

type Config = ()

Source§

fn new(_config: &Self::Config) -> Self

Source§

impl New for u16

Source§

type Config = ()

Source§

fn new(_config: &Self::Config) -> Self

Source§

impl New for u32

Source§

type Config = ()

Source§

fn new(_config: &Self::Config) -> Self

Source§

impl New for u64

Source§

type Config = ()

Source§

fn new(_config: &Self::Config) -> Self

Source§

impl New for usize

Source§

type Config = ()

Source§

fn new(_config: &Self::Config) -> Self

Implementors§