pub struct SessionRegistry { /* private fields */ }Expand description
Registry of active protocol sessions for an agent.
Each agent maintains its own session registry to track ongoing protocol sessions.
Implementations§
Source§impl SessionRegistry
impl SessionRegistry
Sourcepub fn start_session(
&mut self,
session_id: SessionId,
protocol: String,
role: String,
state: Box<dyn ProtocolStateMachine>,
partner: SenderHandle,
)
pub fn start_session( &mut self, session_id: SessionId, protocol: String, role: String, state: Box<dyn ProtocolStateMachine>, partner: SenderHandle, )
Start a new protocol session.
Sourcepub fn get(&self, session_id: &SessionId) -> Option<&SessionState>
pub fn get(&self, session_id: &SessionId) -> Option<&SessionState>
Get a session by ID.
Sourcepub fn get_mut(&mut self, session_id: &SessionId) -> Option<&mut SessionState>
pub fn get_mut(&mut self, session_id: &SessionId) -> Option<&mut SessionState>
Get a mutable reference to a session by ID.
Sourcepub fn remove(&mut self, session_id: &SessionId) -> Option<SessionState>
pub fn remove(&mut self, session_id: &SessionId) -> Option<SessionState>
Remove and return a session (e.g., when protocol completes).
Trait Implementations§
Source§impl Debug for SessionRegistry
impl Debug for SessionRegistry
Source§impl Default for SessionRegistry
impl Default for SessionRegistry
Source§fn default() -> SessionRegistry
fn default() -> SessionRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for SessionRegistry
impl !RefUnwindSafe for SessionRegistry
impl Send for SessionRegistry
impl Sync for SessionRegistry
impl Unpin for SessionRegistry
impl UnsafeUnpin for SessionRegistry
impl !UnwindSafe for SessionRegistry
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