generic_container/
lib.rs

1// See https://linebender.org/blog/doc-include for this README inclusion strategy
2//! [Arc]: std::sync::Arc
3//! [`Clone`]: Clone
4//! [`Copy`]: Copy
5//! [`Drop`]: Drop
6//! [`FnOnce`]: FnOnce
7//! [`Fn`]: Fn
8//! [`FnMut`]: FnMut
9//! [`Send`]: Send
10//! [`Sized`]: Sized
11//! [`Sync`]: Sync
12//!
13//! [`Ref`]: FragileTryContainer::Ref
14//! [`RefMut`]: FragileTryMutContainer::RefMut
15//! [`GenericContainer<T, C>`]: GenericContainer
16//! [`TryContainer`]: TryContainer
17//! [`TryMutContainer<T>`]: TryMutContainer
18//!
19// File links are not supported by rustdoc
20//! [LICENSE-APACHE]: https://github.com/robofinch/generic-container/blob/main/LICENSE-APACHE
21//! [LICENSE-MIT]: https://github.com/robofinch/generic-container/blob/main/LICENSE-MIT
22//!
23//! <style>
24//! .rustdoc-hidden { display: none; }
25//! </style>
26#![cfg_attr(doc, doc = include_str!("../README.md"))]
27
28
29#![no_std]
30#![warn(clippy::std_instead_of_alloc)]
31#![warn(clippy::std_instead_of_core)]
32
33#[cfg(feature = "alloc")]
34extern crate alloc;
35
36#[cfg(feature = "std")]
37extern crate std;
38
39
40mod container_traits;
41mod impls;
42mod generic_container;
43
44
45// `dupe` is only used in doctests, which still triggers the `unused_crate_dependencies` lint.
46#[cfg(test)]
47use dupe as _;
48
49
50pub use self::generic_container::GenericContainer;
51pub use self::container_traits::{
52    // The core eight
53    FragileTryContainer,    TryContainer,    FragileContainer,    Container,
54    FragileTryMutContainer, TryMutContainer, FragileMutContainer, MutContainer,
55
56    // Non-nightly "trait aliases"
57    BaseContainer, BaseMutContainer,
58};
59
60#[cfg(feature = "alloc")]
61pub use self::impls::CheckedRcRefCell;
62#[cfg(feature = "thread-checked-lock")]
63pub use self::impls::ErasedLockError;