#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(not(feature = "unsafe"), forbid(unsafe_code))]
#![deny(missing_docs)]
#![deny(clippy::all)]
#![warn(clippy::pedantic, clippy::nursery)]
#[cfg(feature = "alloc")]
extern crate alloc;
#[cfg(feature = "alloc")]
mod alloc_util;
mod canonical;
mod codec;
mod error;
mod limits;
mod parse;
mod profile;
mod query;
mod scalar;
#[cfg(feature = "serde")]
mod serde_impl;
pub(crate) mod utf8;
mod wire;
#[cfg(feature = "alloc")]
mod edit;
#[cfg(feature = "alloc")]
mod int;
pub use crate::canonical::{CanonicalCborRef, EncodedTextKey};
pub use crate::codec::{
decode, decode_canonical, ArrayDecoder, CborDecode, CheckedDecoder, Decoder, MapDecoder,
TrustedDecoder,
};
pub use crate::error::{CborError, ErrorCode};
pub use crate::limits::{CborLimits, DecodeLimits};
pub use crate::parse::{validate, validate_canonical};
pub use crate::profile::{MAX_SAFE_INTEGER, MAX_SAFE_INTEGER_I64, MIN_SAFE_INTEGER};
pub use crate::query::{
ArrayRef, BigIntRef, CborIntegerRef, CborKind, CborValueRef, MapRef, PathElem,
};
pub use crate::scalar::F64Bits;
#[cfg(feature = "alloc")]
mod encode;
#[cfg(feature = "alloc")]
mod macros;
#[cfg(feature = "alloc")]
mod value;
#[cfg(feature = "alloc")]
pub use crate::canonical::CanonicalCbor;
#[cfg(feature = "alloc")]
pub use crate::codec::{
decode_canonical_owned, encode_into, encode_to_canonical, encode_to_vec, CborArrayElem,
CborEncode, MapEntries,
};
#[cfg(feature = "alloc")]
pub use crate::edit::{
ArrayPos, ArraySpliceBuilder, DeleteMode, EditEncode, EditOptions, EditValue, Editor, SetMode,
};
#[cfg(feature = "alloc")]
pub use crate::encode::{ArrayEncoder, Encoder, MapEncoder};
#[cfg(feature = "alloc")]
#[doc(hidden)]
pub use crate::macros::__cbor_macro;
#[cfg(feature = "alloc")]
pub use crate::value::{BigInt, CborInteger};
#[cfg(feature = "alloc")]
pub use sacp_cbor_derive::cbor_bytes;
#[cfg(feature = "serde")]
pub use crate::serde_impl::{
from_canonical_bytes, from_canonical_bytes_ref, from_slice, from_slice_borrowed, to_vec,
to_vec_sorted_maps, DeError,
};
pub use sacp_cbor_derive::{CborDecode, CborEncode};
#[macro_export]
macro_rules! path {
($($seg:expr),* $(,)?) => {
&[$($crate::__path_elem!($seg)),*]
};
}
#[doc(hidden)]
#[macro_export]
macro_rules! __path_elem {
($seg:expr) => {
$crate::PathElem::from($seg)
};
}