shizuku/
lib.rs

1#![deny(rustdoc::broken_intra_doc_links)]
2#![warn(missing_docs)]
3#![deny(clippy::unwrap_used)]
4#![deny(clippy::expect_used)]
5#![deny(clippy::panic)]
6#![doc = include_str!("../README.md")]
7#![doc(html_logo_url = "https://raw.githubusercontent.com/suitsu31-club/shizuku/refs/heads/main/assets/icon.svg")]
8
9/// Core of Shizuku.
10/// 
11/// This part defines the general traits and utilities.
12pub mod core;
13
14/// [JetStream](https://docs.nats.io/nats-concepts/jetstream) support.
15pub mod jetstream;
16
17/// [Key/Value Store](https://docs.nats.io/nats-concepts/jetstream/key-value-store) support.
18pub mod kv;
19
20/// Service RPC support. Using just NATS core features.
21pub mod service_rpc;
22
23#[cfg(test)]
24mod tests;
25mod fn_macro;
26
27pub use kanau::*;
28pub use kanau;
29
30pub use core::message::*;
31pub use core::error;
32pub use core::error::Error;
33pub use core::processor::*;
34
35pub use tracing;
36pub use futures;
37
38#[cfg(feature = "json")]
39/// Implement [ByteDeserialize] by `serde_json` if it already implements `serde::Deserialize`.
40pub use shizuku_macros::JsonByteDes;
41
42#[cfg(feature = "json")]
43/// Implement [ByteSerialize] by `serde_json` if it already implements `serde::Serialize`.
44pub use shizuku_macros::JsonByteSer;
45
46#[cfg(feature = "protobuf")]
47/// Implement [ByteDeserialize] by `prost` if it already implements `prost::Message`.
48pub use shizuku_macros::ProtoDes;
49
50#[cfg(feature = "protobuf")]
51/// Implement [ByteSerialize] by `prost` if it already implements `prost::Message`.
52pub use shizuku_macros::ProtoSer;
53
54#[cfg(feature = "bincode")]
55/// Implement [ByteDeserialize] by `bincode` if it already implements `bincode::Decode`.
56pub use shizuku_macros::BincodeByteDes;
57
58#[cfg(feature = "bincode")]
59/// Implement [ByteSerialize] by `bincode` if it already implements `bincode::Encode`.
60pub use shizuku_macros::BincodeByteSer;
61
62/// reexports of essentials
63pub mod prelude {
64    pub use crate::core::error::Error;
65    pub use kanau::processor::{Processor, FinalProcessor};
66    pub use kanau::flow::EarlyReturn;
67    pub use kanau::early_return;
68    pub use crate::core::message::{
69        ByteSerialize, 
70        ByteDeserialize,
71        StaticSubjectMessage, 
72        JetStreamMessageSendTrait
73    };
74    pub use crate::kv::{KeyValue, KeyValueRead, KeyValueWrite};
75}