Go to file
Nikita Pekin 668bb2fa97 impr: add T: Send for AtomicLazyCell Sync impl
Add a `T: Send` to the existing `T: Sync` restriction on the `AtomicLazyCell`
`Sync` impl.
This is necessary because filling an `AtomicLazyCell` only requires a reference
to the cell (i.e. `&AtomicLazyCell`), which means that an empty
`&AtomicLazyCell<T>` can be passed to a child thread (provided that
`AtomicLazyCell<T>: Sync` is satisfied), and filled on the child thread.
The filled value would then be on the stack of, and destroyed by, the
parent thread.

Kudos to dbaupp on Reddit for this recommendation.

Closes #67.
BREAKING CHANGE: the `AtomicLazyCell` `Sync` impl now has a `<T: Sync + Send>`
    constraint instead of a `<T: Sync>` constraint.

    To migrate your code, remove any `AtomicLazyCell<T>` instances where
    `<T: Sync + !Send>`, as this usecase is no longer supported.
2017-11-25 12:48:40 -05:00
src impr: add T: Send for AtomicLazyCell Sync impl 2017-11-25 12:48:40 -05:00
tests impr(LazyCell): return Err(value) on full cell 2016-08-17 03:08:28 -04:00
.clog.toml chore(CONTRIBUTING): add CONTRIBUTING.md 2016-03-28 07:10:30 -04:00
.gitignore feat: add initial commit 2016-03-15 21:29:11 -04:00
.travis.yml chore: increment minimum rustc version 2017-11-24 09:41:18 -05:00
Cargo.toml chore: cut the 0.5.0 release 2017-03-23 23:11:46 -04:00
CHANGELOG.md chore: cut the 0.5.0 release 2017-03-23 23:11:46 -04:00
CONTRIBUTING.md chore: add copyright & contribution info 2017-02-23 13:42:02 -05:00
CONTRIBUTORS.md chore: Aleksey Kladov to CONTRIBUTORS.md 2017-11-24 16:19:26 -05:00
LICENSE-APACHE feat: add initial implementation 2016-03-15 21:29:11 -04:00
LICENSE-MIT chore: update copyright dates 2017-02-23 13:41:51 -05:00
README.md chore: remove appveyor CI support 2017-02-17 14:15:56 -05:00
rustfmt.toml style: apply rustfmt to code 2017-02-17 12:22:17 -05:00

lazycell

Linux travis-badge
api-docs-badge crates-io license-badge coveralls-badge

Rust library providing a lazily filled Cell.

Table of Contents

Usage

Add the following to your Cargo.toml:

[dependencies]
lazycell = "0.5"

And in your lib.rs or main.rs:

extern crate lazycell;

See the API docs for information on using the crate in your library.

Contributing

Contributions are always welcome! If you have an idea for something to add (code, documentation, tests, examples, etc.) feel free to give it a shot.

Please read CONTRIBUTING.md before you start contributing.

Credits

The LazyCell library is based originally on work by The Rust Project Developers for the project crates.io.

The list of contributors to this project can be found at CONTRIBUTORS.md.

License

LazyCell is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE, and LICENSE-MIT for details.