#![warn(clippy::unwrap_used)]
pub mod enc;
pub mod error;
pub mod fuid;
pub mod get_type;
pub mod id64;
pub mod key_part;
pub mod key_type;
pub mod num_ops;
pub mod record_status;
pub mod typ;
pub mod zbase;
#[cfg(feature = "std")]
pub mod persist;
use arrayvec::ArrayString;
pub use armour_derive::*;
pub use error::ArmourError;
pub use fuid::Fuid;
pub use get_type::GetType;
pub use id64::Id64;
pub use key_type::{KeyScheme, KeyType};
pub use typ::{EnumType, Fields, SimpleEnumType, StructType, Typ};
pub mod dyn_types {
pub use crate::get_type;
pub use crate::typ::{EnumType, Fields, SimpleEnumType, StructType, Typ};
}
pub type IdStr = ArrayString<13>;
pub type Result<T, E = ArmourError> = core::result::Result<T, E>;
#[macro_export]
macro_rules! const_hasher {
($m_name: ident, $key_name: literal) => {
pub mod $m_name {
use $crate::enc::{Cipher, IdHasher};
#[derive(Debug, PartialOrd, Ord, PartialEq, Eq, Clone, Copy, Hash)]
pub struct Hasher;
impl IdHasher for Hasher {
const HASHER: Cipher = Cipher::new(env!(concat!("APP_ID_KEY_", $key_name)));
}
}
};
}
#[macro_export]
macro_rules! hasher {
($m_name: ident, $key: literal) => {
pub mod $m_name {
use $crate::enc::{Cipher, IdHasher};
#[derive(Debug, PartialOrd, Ord, PartialEq, Eq, Clone, Copy, Hash)]
pub struct Hasher;
impl IdHasher for Hasher {
const HASHER: Cipher = Cipher::new($key);
}
}
};
}