Install
Prerequisites
Before installing Shizuku, ensure you have:
- Rust toolchain installed (latest stable version)
- Basic understanding of Rust (see Before You Start)
- A running NATS server (see What is NATS)
Adding Shizuku to Your Project
Add Shizuku to your project’s Cargo.toml
:
[dependencies]shizuku = "0.0.2-alpha.2"
Optional Features
Shizuku provides several optional features that you can enable:
[dependencies]shizuku = { version = "0.0.2-alpha.2", features = ["json", "protobuf"] }
Available features:
Quick Start
- Create a new Rust project:
cargo new my-shizuku-servicecd my-shizuku-service
-
Add Shizuku to your dependencies as shown above
-
Create a basic service:
use shizuku::service_rpc::FinalNatsProcessor;use async_nats::Message;use bytes::Bytes;
struct EchoService;
impl FinalNatsProcessor<Message, Result<Bytes, Error>> for EchoService { async fn process(_state: Arc<Self>, msg: Message) -> Result<Bytes, Error> { Ok(msg.payload.into()) }}
Next Steps
- Learn about What is Shizuku
- Explore Core Concepts
- Check out the API Reference