use commonware_codec::{Codec, EncodeFixed};
use core::{
cmp::{Ord, PartialOrd},
error::Error as CoreError,
fmt::{Debug, Display},
hash::Hash,
ops::Deref,
};
use thiserror::Error;
pub mod fixed_bytes;
pub use fixed_bytes::FixedBytes;
pub mod u64;
pub use u64::U64;
pub mod prefixed_u64;
pub mod u32;
pub use u32::U32;
pub mod unit;
pub use unit::Unit;
#[derive(Error, Debug, PartialEq)]
pub enum Error<E: CoreError + Send + Sync + 'static> {
#[error("invalid bytes")]
InsufficientBytes,
#[error("other: {0}")]
Other(E),
}
pub trait Span:
Clone
+ Send
+ Sync
+ 'static
+ Eq
+ PartialEq
+ Ord
+ PartialOrd
+ Debug
+ Hash
+ Display
+ Codec<Cfg = ()>
{
}
impl Span for u8 {}
impl Span for u16 {}
impl Span for u32 {}
impl Span for u64 {}
impl Span for u128 {}
impl Span for i8 {}
impl Span for i16 {}
impl Span for i32 {}
impl Span for i64 {}
impl Span for i128 {}
pub trait Array: Span + EncodeFixed + AsRef<[u8]> + Deref<Target = [u8]> {}