sigma-bounded 0.2.0

Bounded Vec, String, and map types abstracting alloc vs heapless
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Errors from bounded collection operations.

/// Failure modes for [`super::Vec`], [`super::String`], and [`super::BTreeMap`].
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub enum Error {
    /// Capacity or element bound (`N`) would be exceeded.
    CapacityExceeded,
    /// UTF-8 validation failed.
    InvalidUtf8,
}

/// Result alias for bounded-collection operations.
pub type Result<T> = core::result::Result<T, Error>;