3 releases

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

#2174 in Rust patterns

Download history 75/week @ 2023-11-20 52/week @ 2023-11-27 35/week @ 2023-12-04 58/week @ 2023-12-11 61/week @ 2023-12-18 44/week @ 2023-12-25 23/week @ 2024-01-01 68/week @ 2024-01-08 121/week @ 2024-01-15 169/week @ 2024-01-22 128/week @ 2024-01-29 191/week @ 2024-02-05 187/week @ 2024-02-12 413/week @ 2024-02-19 221/week @ 2024-02-26 128/week @ 2024-03-04

957 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