Expand description
Rune SDK for Rust — Caster client library.
Connect to a Rune Runtime, register handlers, and serve requests.
§Example
use rune_framework::{Caster, CasterConfig, RuneConfig, RuneContext};
use bytes::Bytes;
#[tokio::main]
async fn main() {
let caster = Caster::new(CasterConfig::default());
caster.rune(
RuneConfig::new("echo"),
|_ctx: RuneContext, input: Bytes| async move { Ok(input) },
).unwrap();
caster.run().await.unwrap();
}Re-exports§
pub use caster::Caster;pub use config::CasterConfig;pub use config::FileAttachment;pub use config::GateConfig;pub use config::LoadReport;pub use config::RuneConfig;pub use config::ScalePolicy;pub use context::RuneContext;pub use error::SdkError;pub use error::SdkResult;pub use handler::HandlerKind;pub use handler::RegisteredRune;pub use stream::StreamSender;
Modules§
- caster
- Caster — connects to Rune runtime and executes registered handlers.
- config
- Configuration types for the Rune SDK.
- context
- Execution context passed to rune handlers.
- error
- SDK error types.
- handler
- Handler traits and registration types.
- stream
- StreamSender for streaming Rune handlers.