1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc = include_str!("../README.md")]
#![doc(html_favicon_url = "https://zino.cc/assets/zino-logo.png")]
#![doc(html_logo_url = "https://zino.cc/assets/zino-logo.svg")]
#![allow(async_fn_in_trait)]
#![forbid(unsafe_code)]

mod crypto;
mod encoding;
mod helper;
mod mock;
#[cfg(feature = "openapi")]
mod openapi;

#[cfg(feature = "accessor")]
pub mod accessor;
#[cfg(feature = "chatbot")]
pub mod chatbot;
#[cfg(feature = "connector")]
pub mod connector;
#[cfg(feature = "i18n")]
pub mod i18n;
#[cfg(feature = "orm")]
pub mod orm;
#[cfg(feature = "view")]
pub mod view;

pub mod application;
pub mod auth;
pub mod channel;
pub mod datetime;
pub mod error;
pub mod extension;
pub mod file;
pub mod model;
pub mod request;
pub mod response;
pub mod schedule;
pub mod state;
pub mod trace;
pub mod validation;

#[cfg(feature = "i18n")]
#[doc(no_inline)]
pub use fluent::fluent_args;

#[doc(no_inline)]
pub use serde_json::json;

/// A JSON value.
pub type JsonValue = serde_json::Value;

/// A JSON key-value type.
pub type Map = serde_json::Map<String, JsonValue>;

/// An Avro value.
pub type AvroValue = apache_avro::types::Value;

/// A schema-less Avro record value.
pub type Record = Vec<(String, AvroValue)>;

/// A TOML value.
pub type TomlValue = toml::Value;

/// A Universally Unique Identifier (UUID).
pub type Uuid = uuid::Uuid;

/// A 128 bit representation of a fixed-precision decimal number.
pub type Decimal = rust_decimal::Decimal;

/// A value which is initialized on the first access.
pub type LazyLock<T> = once_cell::sync::Lazy<T>;

/// An allocation-optimized string.
pub type SharedString = std::borrow::Cow<'static, str>;

/// An owned dynamically typed error.
pub type BoxError = Box<dyn std::error::Error + Sync + Send + 'static>;

/// An owned dynamically typed future.
pub type BoxFuture<'a, T = ()> =
    std::pin::Pin<Box<dyn std::future::Future<Output = T> + Send + 'a>>;