Skip to main content

rune_framework/
lib.rs

1//! Rune SDK for Rust — Caster client library.
2//!
3//! Connect to a Rune Runtime, register handlers, and serve requests.
4//!
5//! # Example
6//! ```rust,no_run
7//! use rune_framework::{Caster, CasterConfig, RuneConfig, RuneContext};
8//! use bytes::Bytes;
9//!
10//! #[tokio::main]
11//! async fn main() {
12//!     let caster = Caster::new(CasterConfig::default());
13//!
14//!     caster.rune(
15//!         RuneConfig::new("echo"),
16//!         |_ctx: RuneContext, input: Bytes| async move { Ok(input) },
17//!     ).unwrap();
18//!
19//!     caster.run().await.unwrap();
20//! }
21//! ```
22
23pub mod caster;
24pub mod config;
25pub mod context;
26pub mod error;
27pub mod handler;
28mod pilot_client;
29pub mod stream;
30
31// Re-exports for convenience
32pub use caster::Caster;
33pub use config::{CasterConfig, FileAttachment, GateConfig, LoadReport, RuneConfig, ScalePolicy};
34pub use context::RuneContext;
35pub use error::{SdkError, SdkResult};
36pub use handler::{HandlerKind, RegisteredRune};
37pub use pilot_client::PilotClient;
38pub use stream::StreamSender;