pub struct ServerContext { /* private fields */ }Expand description
Per-connection facilities available to a server implementation.
Implementations§
Source§impl ServerContext
impl ServerContext
Sourcepub async fn notify<T>(
&self,
method: &str,
params: &T,
) -> Result<(), TransportError>where
T: Serialize,
pub async fn notify<T>(
&self,
method: &str,
params: &T,
) -> Result<(), TransportError>where
T: Serialize,
Emit one JSON-RPC notification in connection order.
Sourcepub fn shutdown(&self) -> CancellationToken
pub fn shutdown(&self) -> CancellationToken
A cancellation token scoped to this protocol connection.
Sourcepub fn register_session_subscription(&self, session_id: SessionId)
pub fn register_session_subscription(&self, session_id: SessionId)
Marks a session as authorized for connection-scoped live notifications.
Sourcepub fn is_session_subscribed(&self, session_id: SessionId) -> bool
pub fn is_session_subscribed(&self, session_id: SessionId) -> bool
Returns whether this connection has successfully subscribed to the session.
Trait Implementations§
Source§impl Clone for ServerContext
impl Clone for ServerContext
Source§fn clone(&self) -> ServerContext
fn clone(&self) -> ServerContext
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 ServerContext
impl RefUnwindSafe for ServerContext
impl Send for ServerContext
impl Sync for ServerContext
impl Unpin for ServerContext
impl UnsafeUnpin for ServerContext
impl UnwindSafe for ServerContext
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