#lock-free #factory #swapping

factory

Factory trait and its implementations

3 releases

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

#1743 in Rust patterns

Download history 129/week @ 2023-05-30 59/week @ 2023-06-06 115/week @ 2023-06-13 176/week @ 2023-06-20 100/week @ 2023-06-27 343/week @ 2023-07-04 140/week @ 2023-07-11 173/week @ 2023-07-18 155/week @ 2023-07-25 84/week @ 2023-08-01 122/week @ 2023-08-08 129/week @ 2023-08-15 89/week @ 2023-08-22 78/week @ 2023-08-29 132/week @ 2023-09-05 109/week @ 2023-09-12

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

MIT license

9KB
148 lines

factory

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