pub struct StreamHandler { /* private fields */ }Expand description
Stream handler for processing server events
Implementations§
Source§impl StreamHandler
impl StreamHandler
Sourcepub fn set_receiver(&mut self, receiver: UnboundedReceiver<ServerEvent>)
pub fn set_receiver(&mut self, receiver: UnboundedReceiver<ServerEvent>)
Set event receiver from transport
Sourcepub fn on_notification<F>(&self, callback: F)
pub fn on_notification<F>(&self, callback: F)
Set notification callback
Sourcepub fn on_request<F>(&self, callback: F)
pub fn on_request<F>(&self, callback: F)
Set request callback
Sourcepub fn on_connection_lost<F>(&self, callback: F)
pub fn on_connection_lost<F>(&self, callback: F)
Set connection lost callback
Sourcepub fn on_heartbeat<F>(&self, callback: F)
pub fn on_heartbeat<F>(&self, callback: F)
Set heartbeat callback
Sourcepub async fn start(&mut self) -> McpClientResult<()>
pub async fn start(&mut self) -> McpClientResult<()>
Start processing events
Trait Implementations§
Source§impl Debug for StreamHandler
impl Debug for StreamHandler
Auto Trait Implementations§
impl Freeze for StreamHandler
impl !RefUnwindSafe for StreamHandler
impl Send for StreamHandler
impl Sync for StreamHandler
impl Unpin for StreamHandler
impl !UnwindSafe for StreamHandler
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