pylon_workers/lib.rs
1//! Cloudflare Workers adapter for pylon.
2//!
3//! # Architecture
4//!
5//! ```text
6//! Browser ──► Cloudflare Worker
7//! ├─ pylon_router::route() — platform-agnostic routing
8//! ├─ D1DataStore — D1 SQL execution (SQLite)
9//! └─ Durable Object rooms — WebSocket (future)
10//! ```
11//!
12//! # Build (requires `workers` feature)
13//!
14//! ```sh
15//! cargo install worker-build
16//! worker-build --release --features workers
17//! # or: wrangler deploy
18//! ```
19
20pub mod d1_store;
21pub mod durable_object;
22pub mod noop_adapters;
23
24pub use d1_store::{D1DataStore, D1Executor};
25pub use durable_object::{
26 do_websocket_sink, persist_to_do_storage, register_do_subscriber, restore_from_do_storage,
27 DoStorage, DoSubscriberHandle, DURABLE_OBJECT_TEMPLATE_JS,
28};
29pub use noop_adapters::NoopAll;
30
31#[cfg(feature = "workers")]
32pub mod handler;