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#[cfg(any(feature = "kinds", doc))]
46#[cfg_attr(docsrs, doc(cfg(feature = "kinds")))]
47pub mod kinds;
48
49
50// `dupe` is only used in doctests, which still triggers the `unused_crate_dependencies` lint.
51#[cfg(test)]
52use dupe as _;
53
54
55pub use self::generic_container::GenericContainer;
56pub use self::container_traits::{
57    // The core eight
58    FragileTryContainer,    TryContainer,    FragileContainer,    Container,
59    FragileTryMutContainer, TryMutContainer, FragileMutContainer, MutContainer,
60
61    // Non-nightly "trait aliases"
62    BaseContainer, BaseMutContainer,
63};
64
65#[cfg(any(feature = "alloc", doc))]
66#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
67pub use self::impls::CheckedRcRefCell;
68
69#[cfg(feature = "thread-checked-lock")]
70#[cfg_attr(docsrs, doc(cfg(feature = "thread-checked-lock")))]
71pub use self::impls::ErasedLockError;