pub struct Sessions { /* private fields */ }Expand description
Live UI sessions that external entries may address by session_id.
Implementations§
Source§impl Sessions
impl Sessions
pub fn new() -> Self
pub fn register(&self, handler: Arc<dyn SessionHandler>)
pub fn unregister(&self, session_id: &str)
pub fn list(&self) -> Vec<Arc<dyn SessionHandler>>
Sourcepub fn handle(
&self,
session_id: Option<&str>,
command: SessionCommand,
params: Vec<Value>,
) -> Result<Value, CommandError>
pub fn handle( &self, session_id: Option<&str>, command: SessionCommand, params: Vec<Value>, ) -> Result<Value, CommandError>
Route a session command. Without a session id the command goes to the only live session; none or several sessions are explicit errors.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Sessions
impl RefUnwindSafe for Sessions
impl Send for Sessions
impl Sync for Sessions
impl Unpin for Sessions
impl UnsafeUnpin for Sessions
impl UnwindSafe for Sessions
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