Trait Factory

Source
pub trait Factory {
    type Item;

    // Required method
    fn create(&self) -> Self::Item;
}
Expand description

This trait allows for creating any number of instances of the Item type.

Required Associated Types§

Source

type Item

The type of instances created by this factory.

Required Methods§

Source

fn create(&self) -> Self::Item

Creates an instance.

Implementations on Foreign Types§

Source§

impl<T: ?Sized + Factory> Factory for &T

Source§

type Item = <T as Factory>::Item

Source§

fn create(&self) -> Self::Item

Source§

impl<T: ?Sized + Factory> Factory for Box<T>

Source§

type Item = <T as Factory>::Item

Source§

fn create(&self) -> Self::Item

Implementors§