Skip to main content

zino_core/
lib.rs

1#![cfg_attr(docsrs, feature(doc_cfg))]
2#![doc = include_str!("../README.md")]
3#![doc(html_favicon_url = "https://zino.cc/assets/zino-logo.png")]
4#![doc(html_logo_url = "https://zino.cc/assets/zino-logo.svg")]
5#![allow(async_fn_in_trait)]
6
7mod helper;
8mod mock;
9
10pub mod application;
11pub mod crypto;
12pub mod datetime;
13pub mod encoding;
14pub mod error;
15pub mod extension;
16pub mod model;
17pub mod schedule;
18pub mod state;
19pub mod trace;
20pub mod validation;
21
22#[cfg(feature = "i18n")]
23pub mod i18n;
24
25#[cfg(feature = "i18n")]
26#[doc(no_inline)]
27pub use fluent::fluent_args;
28
29#[doc(no_inline)]
30pub use serde_json::json;
31
32/// A JSON value.
33pub type JsonValue = serde_json::Value;
34
35/// A JSON key-value type.
36pub type Map = serde_json::Map<String, JsonValue>;
37
38/// An Avro value.
39pub type AvroValue = apache_avro::types::Value;
40
41/// A schema-less Avro record value.
42pub type Record = Vec<(String, AvroValue)>;
43
44/// A TOML value.
45pub type TomlValue = toml::Value;
46
47/// A Universally Unique Identifier (UUID).
48pub type Uuid = uuid::Uuid;
49
50/// A 128 bit representation of a fixed-precision decimal number.
51pub type Decimal = rust_decimal::Decimal;
52
53/// A value which is initialized on the first access.
54pub type LazyLock<T> = std::sync::LazyLock<T>;
55
56/// An allocation-optimized string.
57pub type SharedString = std::borrow::Cow<'static, str>;
58
59/// An owned dynamically typed error.
60pub type BoxError = Box<dyn std::error::Error + Sync + Send + 'static>;
61
62/// An owned dynamically typed future.
63pub type BoxFuture<'a, T = ()> =
64    std::pin::Pin<Box<dyn std::future::Future<Output = T> + Send + 'a>>;