pub struct PaymentRequiredError {
pub code: i32,
pub message: String,
pub payment_required: PaymentRequired,
}Available on crate features
client or server only.Expand description
Go PaymentRequiredError — JSON-RPC style code 402 with payment data.
Fields§
§code: i32Always MCP_PAYMENT_REQUIRED_CODE (402).
message: StringHuman-readable message.
payment_required: PaymentRequiredPayment requirements payload.
Implementations§
Source§impl PaymentRequiredError
impl PaymentRequiredError
Sourcepub fn new(
message: impl Into<String>,
payment_required: PaymentRequired,
) -> Self
pub fn new( message: impl Into<String>, payment_required: PaymentRequired, ) -> Self
Builds a 402 payment-required error.
Trait Implementations§
Source§impl Clone for PaymentRequiredError
impl Clone for PaymentRequiredError
Source§fn clone(&self) -> PaymentRequiredError
fn clone(&self) -> PaymentRequiredError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PaymentRequiredError
impl Debug for PaymentRequiredError
Source§impl Display for PaymentRequiredError
impl Display for PaymentRequiredError
Source§impl Error for PaymentRequiredError
impl Error for PaymentRequiredError
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 From<Box<PaymentRequiredError>> for McpClientError
impl From<Box<PaymentRequiredError>> for McpClientError
Source§fn from(source: Box<PaymentRequiredError>) -> Self
fn from(source: Box<PaymentRequiredError>) -> Self
Converts to this type from the input type.
Source§impl From<PaymentRequiredError> for McpClientError
impl From<PaymentRequiredError> for McpClientError
Source§fn from(value: PaymentRequiredError) -> Self
fn from(value: PaymentRequiredError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for PaymentRequiredError
impl RefUnwindSafe for PaymentRequiredError
impl Send for PaymentRequiredError
impl Sync for PaymentRequiredError
impl Unpin for PaymentRequiredError
impl UnsafeUnpin for PaymentRequiredError
impl UnwindSafe for PaymentRequiredError
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<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> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more