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#![cfg_attr(docsrs, feature(doc_cfg))]
30
31#![no_std]
32#![warn(clippy::std_instead_of_alloc)]
33#![warn(clippy::std_instead_of_core)]
34
35#[cfg(any(feature = "alloc", doc))]
36extern crate alloc;
37
38#[cfg(any(feature = "std", doc))]
39extern crate std;
40
41
42mod container_traits;
43mod impls;
44mod generic_container;
45
46
47// `dupe` is only used in doctests, which still triggers the `unused_crate_dependencies` lint.
48#[cfg(test)]
49use dupe as _;
50
51
52pub use self::generic_container::GenericContainer;
53pub use self::container_traits::{
54 // The core eight
55 FragileTryContainer, TryContainer, FragileContainer, Container,
56 FragileTryMutContainer, TryMutContainer, FragileMutContainer, MutContainer,
57
58 // Non-nightly "trait aliases"
59 BaseContainer, BaseMutContainer,
60};
61
62#[cfg(any(feature = "alloc", doc))]
63#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
64pub use self::impls::CheckedRcRefCell;
65
66#[cfg(feature = "thread-checked-lock")]
67#[cfg_attr(docsrs, doc(cfg(feature = "thread-checked-lock")))]
68pub use self::impls::ErasedLockError;