3 releases

0.1.2 Apr 16, 2019
0.1.1 Mar 30, 2018
0.1.0 Mar 29, 2018

#2282 in Rust patterns

Download history 46/week @ 2024-01-04 125/week @ 2024-01-11 152/week @ 2024-01-18 143/week @ 2024-01-25 134/week @ 2024-02-01 197/week @ 2024-02-08 218/week @ 2024-02-15 403/week @ 2024-02-22 173/week @ 2024-02-29 98/week @ 2024-03-07 110/week @ 2024-03-14 138/week @ 2024-03-21 159/week @ 2024-03-28 126/week @ 2024-04-04 86/week @ 2024-04-11 77/week @ 2024-04-18

466 downloads per month
Used in 17 crates (7 directly)

MIT license

9KB
148 lines

factory

Documentation Build Status Code Coverage License: MIT

This crate provides Factory trait and its implementations.

The trait makes it possible to create any number of instances of a specific type.

Documentation

Examples

Creates default instances of u8 type:

use factory::{DefaultFactory, Factory};

let f = DefaultFactory::<u8>::new();
assert_eq!(f.create(), 0);

lib.rs:

This crate provides Factory trait and its implementations.

The trait makes it possible to create any number of instances of a specific type.

Examples

Creates default instances of u8 type:

use factory::{DefaultFactory, Factory};

let f = DefaultFactory::<u8>::new();
assert_eq!(f.create(), 0);
assert_eq!(f.create(), 0);

Dependencies