pub enum ActorHandler {
Lex(Value),
Native(Arc<NativeActorHandler>),
}Expand description
Two ways an actor’s handler can be implemented.
-
Lex(Value::Closure)is the user-spawned shape fromconc.spawn(state, fn (s, m) -> (s, r) { … }). The VM calls the closure with(state, msg)and expects(new_state, reply). -
Native(...)is a Rust-side bridge — the actor cell wraps aBox<dyn Fn(Value) -> Result<Value, String>>that lives outside the VM. Thestateis ignored; the bridge is fire-and-forget over an out-of-band channel (e.g. ampsc::Sender<String>to a WebSocket connection — seelex-runtime::ws::serve_ws_fn_actor).conc.askagainst a native actor returns whatever the bridge produces;conc.telldiscards it. v1 is only used internally by the WS server’s outbound-bridge registration; not exposed via theconcbuiltin surface.
Variants§
Lex(Value)
Native(Arc<NativeActorHandler>)
Trait Implementations§
Source§impl Clone for ActorHandler
impl Clone for ActorHandler
Source§fn clone(&self) -> ActorHandler
fn clone(&self) -> ActorHandler
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ActorHandler
impl !RefUnwindSafe for ActorHandler
impl Send for ActorHandler
impl Sync for ActorHandler
impl Unpin for ActorHandler
impl UnsafeUnpin for ActorHandler
impl !UnwindSafe for ActorHandler
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