extern crate self as icydb_model;
pub mod application;
pub mod base;
#[cfg(all(feature = "build", not(target_arch = "wasm32")))]
pub mod build;
pub mod error;
#[cfg(all(feature = "build", not(target_arch = "wasm32")))]
pub mod fragment;
#[cfg(all(feature = "build", not(target_arch = "wasm32")))]
pub mod node;
pub mod normalize;
#[cfg(all(feature = "build", not(target_arch = "wasm32")))]
mod schema_validate;
mod typed_adapter;
pub mod types;
pub mod validate;
#[cfg(all(feature = "build", not(target_arch = "wasm32")))]
mod visit;
pub mod visitor;
#[cfg(all(feature = "build", not(target_arch = "wasm32")))]
use crate::{build::BuildError, node::NodeError};
#[cfg(all(feature = "build", not(target_arch = "wasm32")))]
use thiserror::Error as ThisError;
pub mod prelude {
#[cfg(all(feature = "build", not(target_arch = "wasm32")))]
pub(crate) use crate::build::schema_read;
#[cfg(all(feature = "build", not(target_arch = "wasm32")))]
pub use crate::node::*;
pub use crate::{
EntitySource as _, Inner as _, NormalizeAndValidate as _, Path as _, base, canister,
entity, enum_, err,
error::ErrorTree,
list, map, newtype, normalizer, record,
schema::*,
set, store, tuple,
types::{Cardinality, Primitive},
validator,
visitor::{
Issue, Normalize as _, NormalizeAuto, NormalizeCustom, Normalizer as _, Validate as _,
ValidateAuto, ValidateCustom, Validator as _, Visitable as _, VisitorContext,
},
};
#[cfg(all(feature = "build", not(target_arch = "wasm32")))]
pub(crate) use crate::{
node::{MacroNode, ValidateNode, VisitableNode},
visit::Visitor,
};
pub use serde::{Deserialize, Serialize};
}
pub use application::NormalizeAndValidate;
pub use icydb_model_macros::{
Add, AddAssign, Deref, DerefMut, Display, Div, DivAssign, Inner, Mul, MulAssign, Neg, Product,
Rem, RemAssign, Sub, SubAssign, Sum, canister, entity, enum_, list, map, newtype, normalizer,
record, set, store, tuple, validator,
};
pub use icydb_schema::MAX_INDEX_FIELDS;
pub use normalize::normalize;
#[doc(hidden)]
pub use typed_adapter::{
TypedAdapterContext, TypedEnumDescriptor, TypedEnumSelection, TypedInputValue, TypedNamedType,
TypedOutputValue, TypedScalarValue, TypedValueError,
};
pub use validate::validate;
pub trait Path {
const PATH: &'static str;
}
pub trait EntitySource {
const ENTITY: &'static str;
}
pub trait Inner<T> {
fn inner(&self) -> &T;
fn into_inner(self) -> T;
}
pub mod schema {
pub use icydb_schema::*;
}
#[doc(hidden)]
pub mod __reexports {
#[cfg(all(feature = "build", not(target_arch = "wasm32")))]
pub use ctor;
pub use icydb_model_macros;
pub use remain;
pub use serde;
}
#[cfg(all(feature = "build", not(target_arch = "wasm32")))]
#[derive(Debug, ThisError)]
pub enum Error {
#[error(transparent)]
BuildError(#[from] BuildError),
#[error(transparent)]
NodeError(#[from] NodeError),
}
#[cfg(all(test, feature = "build", not(target_arch = "wasm32")))]
mod tests;
#[doc(hidden)]
#[cfg(all(feature = "build", not(target_arch = "wasm32")))]
#[macro_export]
macro_rules! __icydb_register_schema {
($($item:item)*) => { $($item)* };
}
#[doc(hidden)]
#[cfg(not(all(feature = "build", not(target_arch = "wasm32"))))]
#[macro_export]
macro_rules! __icydb_register_schema {
($($item:item)*) => {};
}