pub struct MessageRouter {
pub run_registry: RunRegistry,
/* private fields */
}Fields§
§run_registry: RunRegistryTracks every spawned gateway run so gateway abort can cancel it.
Implementations§
Source§impl MessageRouter
impl MessageRouter
pub fn new( engine: Arc<Engine>, recorder: Arc<FsRecorder>, event_bus_tx: Sender<Event>, allowed_users: Vec<String>, ) -> Self
Sourcepub fn with_sessions(self, sessions: Arc<SessionStore>) -> Self
pub fn with_sessions(self, sessions: Arc<SessionStore>) -> Self
Attach a session store to enable cross-surface conversation continuity.
Sourcepub fn session_key(msg_user_id: &str, surface: &str, chat_id: &str) -> String
pub fn session_key(msg_user_id: &str, surface: &str, chat_id: &str) -> String
Stable gateway session key. OpenClaw-style gateway continuity is scoped by surface + channel/account + peer, so a user can have separate sessions in separate channels while still surviving restarts.
Sourcepub async fn route(
&self,
msg: GatewayMessage,
responses: &UnboundedSender<GatewayResponse>,
)
pub async fn route( &self, msg: GatewayMessage, responses: &UnboundedSender<GatewayResponse>, )
Route an incoming message: parse command, submit to engine, return response
Auto Trait Implementations§
impl !RefUnwindSafe for MessageRouter
impl !UnwindSafe for MessageRouter
impl Freeze for MessageRouter
impl Send for MessageRouter
impl Sync for MessageRouter
impl Unpin for MessageRouter
impl UnsafeUnpin for MessageRouter
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more