pub struct McpState {
pub subscribed: Arc<Mutex<HashSet<String>>>,
pub notif_tx: Arc<Mutex<Option<Sender<String>>>>,
}Expand description
Shared MCP-session state. Today: subscribed resource URIs + a writer channel for unsolicited notifications (push). Future per-session cursors, etc. go here.
Fields§
§subscribed: Arc<Mutex<HashSet<String>>>Resource URIs the client has subscribed to. Wildcard support is
intentionally NOT done — clients subscribe to specific URIs and
receive notifications/resources/updated only for those URIs.
notif_tx: Arc<Mutex<Option<Sender<String>>>>Writer-channel sender for emitting unsolicited notifications
(notifications/resources/list_changed, etc.). Populated by run()
before tools are dispatched; None in unit tests.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for McpState
impl RefUnwindSafe for McpState
impl Send for McpState
impl Sync for McpState
impl Unpin for McpState
impl UnsafeUnpin for McpState
impl UnwindSafe for McpState
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