honeycomb_core/attributes/
mod.rs

1//! attribute modeling code
2//!
3//! This module contains all code related to generic attribute modelling and handling.
4
5mod collections;
6mod manager;
7mod traits;
8
9pub use collections::AttrSparseVec;
10pub use traits::{AttributeBind, AttributeStorage, AttributeUpdate, UnknownAttributeStorage};
11
12pub(crate) use manager::AttrStorageManager;
13
14/// Attribute operation error enum
15#[derive(Debug, thiserror::Error, PartialEq, Eq)]
16pub enum AttributeError {
17    /// Use in your custom [`AttributeUpdate::merge`], [`AttributeUpdate::merge_incomplete`], and
18    /// [`AttributeUpdate::merge_from_none`] implementations.
19    #[error("cannot merge attribute {0}: {1}")]
20    FailedMerge(&'static str, &'static str),
21    /// Use in your custom [`AttributeUpdate::split`], [`AttributeUpdate::split_from_none`]
22    /// implementations.
23    #[error("cannot split attribute {0}: {1}")]
24    FailedSplit(&'static str, &'static str),
25    /// Default return for fallback functions of [`AttributeUpdate`].
26    #[error("insufficient data to complete {0} operation on {1}")]
27    InsufficientData(&'static str, &'static str),
28}
29
30// ------ TESTS
31
32#[allow(clippy::float_cmp)]
33#[cfg(test)]
34mod tests;