Skip to main content

sz_rust_state_facade/
lib.rs

1//! SZ-Rust State Facade
2//!
3//! 提取自 `sz-rust-core` 的应用状态与基础服务模块,提供会话、Cookie、环境、
4//! 事件、国际化、邮件、通知七大基础能力。
5//!
6//! ## 模块结构
7//!
8//! | 模块 | 对齐 PHP | 说明 |
9//! |------|---------|------|
10//! | [`session`] | `think\facade\Session` | 会话管理(SessionStore trait + MemorySessionStore) |
11//! | [`cookie`] | `think\Cookie` | Cookie 管理(CookieJar + CookieOptions) |
12//! | `env` | `think\facade\Env` | 环境变量管理(Env 单例 + get/set) |
13//! | [`event`] | `think\Event` | 事件系统(Listener/Subscriber/Observer) |
14//! | [`i18n`] | `think\facade\Lang` | 多语言国际化(Lang 字典 + 占位符替换) |
15//! | [`mail`] | `think\facade\Mail` | 邮件抽象(Mailer trait + MemoryMailer) |
16//! | [`notify`] | `think\facade\Notify` | 通知抽象(Notifier trait + MemoryNotifier + SlackNotifier) |
17//!
18//! ## 用法
19//!
20//! ```ignore
21//! use sz_rust_state_facade::session::{SessionStore, MemorySessionStore};
22//! use sz_rust_state_facade::cookie::CookieJar;
23//! use sz_rust_state_facade::env::Env;
24//! use sz_rust_state_facade::event::EventDispatcher;
25//! ```
26//!
27//! ## 与 sz-rust-core 的关系
28//!
29//! `sz-rust-core` 通过 `pub use sz_rust_state_facade as state;` 重导出本 crate,
30//! 因此 `sz_rust_core::state::session` 等价于 `sz_rust_state_facade::session`。
31//! 下游业务包推荐直接依赖 `sz-rust-state-facade` 以减少编译耦合。
32
33#![deny(unsafe_code)]
34#![warn(missing_docs)]
35
36pub mod cookie;
37pub mod env;
38pub mod event;
39pub mod i18n;
40pub mod mail;
41pub mod notify;
42pub mod session;