pub struct UpstreamPeerRegistry { /* private fields */ }Expand description
Registry of upstream session peers that should receive backend notifications.
Implementations§
Source§impl UpstreamPeerRegistry
impl UpstreamPeerRegistry
Sourcepub fn register(&self, peer: Peer<RoleServer>) -> u64
pub fn register(&self, peer: Peer<RoleServer>) -> u64
Register an upstream peer (typically from ServerHandler::on_initialized).
Sourcepub fn unregister(&self, id: u64)
pub fn unregister(&self, id: u64)
Explicitly remove a registered peer by id.
Sourcepub fn register_progress(&self, token: ProgressToken, peer: Peer<RoleServer>)
pub fn register_progress(&self, token: ProgressToken, peer: Peer<RoleServer>)
Bind a progress token to the upstream peer that owns the request.
Sourcepub fn unregister_progress(&self, token: &ProgressToken)
pub fn unregister_progress(&self, token: &ProgressToken)
Remove a progress-token route (request finished or cancelled).
Sourcepub fn register_task(&self, task_id: impl Into<String>, peer: Peer<RoleServer>)
pub fn register_task(&self, task_id: impl Into<String>, peer: Peer<RoleServer>)
Bind a task id to the upstream peer that created/enqueued the task.
Sourcepub fn unregister_task(&self, task_id: &str)
pub fn unregister_task(&self, task_id: &str)
Remove a task-id route.
Sourcepub fn reap_closed_peers(&self)
pub fn reap_closed_peers(&self)
Drop peers whose transport is already closed (eager cleanup on session close).
Sourcepub async fn deliver_progress(&self, params: ProgressNotificationParam)
pub async fn deliver_progress(&self, params: ProgressNotificationParam)
Deliver a progress notification to the owning upstream peer only.
Sourcepub async fn deliver_task_status(&self, params: TaskStatusNotificationParams)
pub async fn deliver_task_status(&self, params: TaskStatusNotificationParams)
Deliver a task-status notification to the owning upstream peer only.
Trait Implementations§
Source§impl Debug for UpstreamPeerRegistry
impl Debug for UpstreamPeerRegistry
Auto Trait Implementations§
impl !Freeze for UpstreamPeerRegistry
impl !RefUnwindSafe for UpstreamPeerRegistry
impl !UnwindSafe for UpstreamPeerRegistry
impl Send for UpstreamPeerRegistry
impl Sync for UpstreamPeerRegistry
impl Unpin for UpstreamPeerRegistry
impl UnsafeUnpin for UpstreamPeerRegistry
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