#![cfg_attr(
any(
arm_llsc,
all(
target_pointer_width = "32",
any(target_has_atomic = "64", feature = "portable-atomic")
),
all(
target_pointer_width = "64",
any(
all(target_has_atomic = "128", feature = "nightly"),
feature = "portable-atomic"
)
)
),
doc = "- [`Arc`][pool::arc::Arc]: Like `std::sync::Arc` but backed by a lock-free memory pool rather than `[global_allocator]`."
)]
#![cfg_attr(
any(
arm_llsc,
all(
target_pointer_width = "32",
any(target_has_atomic = "64", feature = "portable-atomic")
),
all(
target_pointer_width = "64",
any(
all(target_has_atomic = "128", feature = "nightly"),
feature = "portable-atomic"
)
)
),
doc = "- [`Box`][pool::boxed::Box]: Like `std::boxed::Box` but backed by a lock-free memory pool rather than `[global_allocator]`."
)]
#: Objects managed by an object pool."
)]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(not(test), no_std)]
#![deny(missing_docs)]
#![cfg_attr(
all(
feature = "nightly",
target_pointer_width = "64",
target_has_atomic = "128"
),
feature(integer_atomics)
)]
#![warn(
clippy::use_self,
clippy::too_long_first_doc_paragraph,
clippy::redundant_pub_crate,
clippy::option_if_let_else,
clippy::ptr_as_ptr,
clippy::ref_as_ptr,
clippy::doc_markdown,
clippy::semicolon_if_nothing_returned,
clippy::if_not_else
)]
#[cfg(feature = "alloc")]
extern crate alloc;
pub use binary_heap::BinaryHeap;
pub use c_string::CString;
pub use deque::Deque;
pub use history_buf::{HistoryBuf, OldestOrdered};
pub use index_map::IndexMap;
pub use index_set::IndexSet;
pub use len_type::LenType;
pub use linear_map::LinearMap;
pub use string::String;
pub use vec::{Vec, VecView};
#[macro_use]
#[cfg(test)]
mod test_helpers;
pub mod c_string;
pub mod deque;
pub mod history_buf;
pub mod index_map;
pub mod index_set;
mod len_type;
pub mod linear_map;
mod slice;
pub mod storage;
pub mod string;
pub mod vec;
#[expect(dead_code)]
fn dead_code_ice_workaround() {}
#[cfg(feature = "serde")]
mod de;
#[cfg(feature = "serde")]
mod ser;
pub mod binary_heap;
#[cfg(feature = "bytes")]
mod bytes;
#[cfg(feature = "defmt")]
mod defmt;
#[cfg(any(
// assume we have all atomics available if we're using portable-atomic
feature = "portable-atomic",
// target has native atomic CAS (mpmc_large requires usize, otherwise just u8)
all(feature = "mpmc_large", target_has_atomic = "ptr"),
all(not(feature = "mpmc_large"), target_has_atomic = "8")
))]
pub mod mpmc;
#[cfg(any(
arm_llsc,
all(
target_pointer_width = "32",
any(target_has_atomic = "64", feature = "portable-atomic")
),
all(
target_pointer_width = "64",
any(
all(target_has_atomic = "128", feature = "nightly"),
feature = "portable-atomic"
)
)
))]
pub mod pool;
pub mod sorted_linked_list;
#[cfg(any(
// assume we have all atomics available if we're using portable-atomic
feature = "portable-atomic",
// target has native atomic CAS. Note this is too restrictive, spsc requires load/store only, not CAS.
// This should be `cfg(target_has_atomic_load_store)`, but that's not stable yet.
target_has_atomic = "ptr",
// or the current target is in a list in build.rs of targets known to have load/store but no CAS.
has_atomic_load_store
))]
pub mod spsc;
#[cfg(feature = "ufmt")]
mod ufmt;
#[cfg(feature = "embedded-io-v0.7")]
mod embedded_io;
#[doc(hidden)]
pub mod _export {
pub use crate::string::format;
}
#[derive(Debug, Default)]
#[non_exhaustive]
pub struct CapacityError;
impl core::fmt::Display for CapacityError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.write_str("insufficient capacity")
}
}
impl core::error::Error for CapacityError {}