pub struct CheckContext {
pub session: McpSession,
pub target: ConnectionTarget,
pub init_result: Option<InitializeResult>,
pub raw_init_response: Option<String>,
pub tools: Option<Vec<Tool>>,
pub request_timeout: Duration,
}Expand description
Context provided to checks during execution.
Fields§
§session: McpSessionThe active MCP session.
target: ConnectionTargetOriginal connection target used to create reconnectable disposable sessions.
init_result: Option<InitializeResult>Parsed initialize result.
raw_init_response: Option<String>Raw initialize response string.
tools: Option<Vec<Tool>>Cached tools list.
request_timeout: DurationPer-request transport timeout.
Implementations§
Source§impl CheckContext
impl CheckContext
Sourcepub fn new(session: McpSession, target: ConnectionTarget) -> Self
pub fn new(session: McpSession, target: ConnectionTarget) -> Self
Create a new check context.
Sourcepub async fn fresh_session(&self) -> Result<McpSession, SessionError>
pub async fn fresh_session(&self) -> Result<McpSession, SessionError>
Spawn a fresh session without initializing it.
Sourcepub async fn disposable_session(&self) -> Result<McpSession, SessionError>
pub async fn disposable_session(&self) -> Result<McpSession, SessionError>
Spawn a fresh disposable session for destructive tests.
The caller is responsible for shutting it down.
Uses spawn_quiet to suppress server stderr noise.
Auto Trait Implementations§
impl !Freeze for CheckContext
impl !RefUnwindSafe for CheckContext
impl Send for CheckContext
impl Sync for CheckContext
impl Unpin for CheckContext
impl UnsafeUnpin for CheckContext
impl !UnwindSafe for CheckContext
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