1#[cfg(any(feature = "std", feature = "alloc"))]
2mod id;
3#[cfg(any(feature = "std", feature = "alloc"))]
4pub use id::*;
5
6mod id_ref;
7pub use id_ref::*;
8
9#[derive(Debug, thiserror::Error)]
11pub enum ParseNodeIdError {
12 #[error("id cannot be empty")]
14 Empty,
15 #[error("id is too large, maximum size is {maximum} bytes, but got {actual} bytes")]
17 TooLarge {
18 maximum: usize,
20 actual: usize,
22 },
23 #[error("insufficient buffer, required: {required}, remaining: {remaining}")]
25 InsufficientBuffer {
26 required: u64,
28 remaining: u64,
30 },
31 #[error(transparent)]
33 Utf8Error(#[from] core::str::Utf8Error),
34}
35
36impl ParseNodeIdError {
37 #[inline]
38 const fn too_large(maximum: usize, actual: usize) -> Self {
39 Self::TooLarge { maximum, actual }
40 }
41}