pub mod cache;
pub mod client;
#[cfg(all(not(target_arch = "wasm32"), feature = "codegen"))]
pub mod codegen;
pub mod codegen_types;
pub mod core;
pub mod entities;
#[cfg(not(target_arch = "wasm32"))]
pub mod operation_index;
#[cfg(not(target_arch = "wasm32"))]
pub mod search;
#[cfg(not(target_arch = "wasm32"))]
pub mod server;
pub mod store;
pub mod utils;
pub mod wire;
pub mod prelude;
#[cfg(feature = "bench")]
pub mod bench_entities;
pub const WS_MAX_MESSAGE_SIZE_BYTES: usize = 64 * 1024 * 1024;
pub const WS_MAX_FRAME_SIZE_BYTES: usize = 64 * 1024 * 1024;
#[cfg(not(target_arch = "wasm32"))]
pub use core::saga;
pub use core::{command, common, item, query, reflection, relationship, report, request, view};
pub use erased_serde; pub use futures; pub use hyphae; pub use inventory;
pub use inventory::submit; #[cfg(not(feature = "ts-export"))]
pub use myko_macros::TsNoop as TS;
pub use myko_macros::*;
pub use partially; pub use serde; pub use serde_json; pub use tracing; pub use ts_rs;
#[cfg(feature = "ts-export")]
pub use ts_rs::TS;
pub use wire::event;
#[cfg(feature = "ts-export")]
#[macro_export]
macro_rules! register_ts_export {
($ty:ty) => {
$crate::inventory::submit! {
$crate::codegen_types::TsExportRegistration {
type_name: stringify!($ty),
export_fn: || <$ty as $crate::ts_rs::TS>::export(),
}
}
};
($($ty:ty),+ $(,)?) => {
$(
$crate::register_ts_export!($ty);
)+
};
}
#[cfg(not(feature = "ts-export"))]
#[macro_export]
macro_rules! register_ts_export {
($($ty:ty),+ $(,)?) => {};
}
#[macro_export]
macro_rules! ts_const {
(pub $name:ident : &str = $value:expr) => {
pub const $name: &str = $value;
$crate::inventory::submit! {
$crate::codegen_types::TsConstRegistration {
name: stringify!($name),
value: $crate::codegen_types::TsConstValue::Str($value),
crate_name: module_path!(),
}
}
};
($name:ident : &str = $value:expr) => {
const $name: &str = $value;
$crate::inventory::submit! {
$crate::codegen_types::TsConstRegistration {
name: stringify!($name),
value: $crate::codegen_types::TsConstValue::Str($value),
crate_name: module_path!(),
}
}
};
(pub $name:ident : i64 = $value:expr) => {
pub const $name: i64 = $value;
$crate::inventory::submit! {
$crate::codegen_types::TsConstRegistration {
name: stringify!($name),
value: $crate::codegen_types::TsConstValue::Int($value),
crate_name: module_path!(),
}
}
};
($name:ident : i64 = $value:expr) => {
const $name: i64 = $value;
$crate::inventory::submit! {
$crate::codegen_types::TsConstRegistration {
name: stringify!($name),
value: $crate::codegen_types::TsConstValue::Int($value),
crate_name: module_path!(),
}
}
};
(pub $name:ident : bool = $value:expr) => {
pub const $name: bool = $value;
$crate::inventory::submit! {
$crate::codegen_types::TsConstRegistration {
name: stringify!($name),
value: $crate::codegen_types::TsConstValue::Bool($value),
crate_name: module_path!(),
}
}
};
($name:ident : bool = $value:expr) => {
const $name: bool = $value;
$crate::inventory::submit! {
$crate::codegen_types::TsConstRegistration {
name: stringify!($name),
value: $crate::codegen_types::TsConstValue::Bool($value),
crate_name: module_path!(),
}
}
};
}
#[macro_export]
macro_rules! submit_message_event {
($variant:ident, $event:expr) => {
inventory::submit!($crate::wire::MessageEventRegistration {
variant_name: stringify!($variant),
event_value: $event,
});
};
}
#[cfg(test)]
pub(crate) mod test_util {
pub(crate) fn scheduler_test_serial() -> std::sync::MutexGuard<'static, ()> {
static LOCK: std::sync::Mutex<()> = std::sync::Mutex::new(());
LOCK.lock().unwrap_or_else(|poisoned| poisoned.into_inner())
}
}