pub struct McpRejection { /* private fields */ }Available on crate feature
unstable_mcp_over_acp only.Expand description
Why an mcp/message request is not admitted.
An admission check returns it. The SDK then answers the request with the
outer ACP error Invalid params (-32602), with this reason as the data
string, and runs nothing else for the request.
Implementations§
Source§impl McpRejection
impl McpRejection
Sourcepub fn session_required() -> Self
pub fn session_required() -> Self
The server needs the session of a request, and the Agent supplied none.
The data string is
this MCP server requires sessionId on mcp/message.
Sourcepub fn session_rejected(reason: impl Display) -> Self
pub fn session_rejected(reason: impl Display) -> Self
The server’s own check of the request’s session failed.
Use it for a session that is not active on the connection and is not a
child the Agent announced for an active session, or that this server
was not declared to. The data string is
sessionId rejected: {reason}. reason is sent to the Agent.
Trait Implementations§
Source§impl Clone for McpRejection
impl Clone for McpRejection
Source§impl Debug for McpRejection
impl Debug for McpRejection
Source§impl Display for McpRejection
impl Display for McpRejection
impl Eq for McpRejection
Source§impl Error for McpRejection
impl Error for McpRejection
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for McpRejection
impl PartialEq for McpRejection
impl StructuralPartialEq for McpRejection
Auto Trait Implementations§
impl Forget for McpRejection
impl Freeze for McpRejection
impl Move for McpRejection
impl RefUnwindSafe for McpRejection
impl Send for McpRejection
impl Sync for McpRejection
impl Unpin for McpRejection
impl UnsafeUnpin for McpRejection
impl UnwindSafe for McpRejection
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Converts this value into a three-state builder argument.
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.