pub struct DefaultHandler {
pub sink: Box<dyn IoSink>,
pub read_root: Option<PathBuf>,
pub budget_used: RefCell<u64>,
pub program: Option<Arc<Program>>,
pub chat_registry: Option<Arc<ChatRegistry>>,
/* private fields */
}Fields§
§sink: Box<dyn IoSink>§read_root: Option<PathBuf>Optional read root for io.read — when set, io.read("p") resolves
to read_root.join(p). Lets tests run without touching the real fs.
budget_used: RefCell<u64>Captured budget consumption (post-static-check, observability only).
program: Option<Arc<Program>>Shared reference to the program, needed by net.serve so the
handler can spin up fresh VMs to dispatch incoming requests.
None if the handler was constructed without a program.
chat_registry: Option<Arc<ChatRegistry>>Chat registry; populated by net.serve_ws’s per-message
dispatch so chat.broadcast / chat.send work from inside
a handler invocation.
Implementations§
Source§impl DefaultHandler
impl DefaultHandler
pub fn new(policy: Policy) -> Self
pub fn with_program(self, program: Arc<Program>) -> Self
pub fn with_chat_registry(self, registry: Arc<ChatRegistry>) -> Self
pub fn with_sink(self, sink: Box<dyn IoSink>) -> Self
pub fn with_read_root(self, root: PathBuf) -> Self
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for DefaultHandler
impl !RefUnwindSafe for DefaultHandler
impl Send for DefaultHandler
impl !Sync for DefaultHandler
impl Unpin for DefaultHandler
impl UnsafeUnpin for DefaultHandler
impl !UnwindSafe for DefaultHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more