pub enum TransportError {
Show 13 variants
Io(Error),
Closed,
ConnectionLimit(String),
InvalidConnection(String),
SessionError(String),
Format {
message: String,
},
Timeout {
duration_ms: u64,
},
BufferOverflow {
details: String,
},
MessageTooLarge {
size: usize,
max_size: usize,
},
IncompleteMessage,
ParseError(String),
SerializationError(String),
Other {
details: String,
},
}Expand description
Common transport error types.
This enum provides a standardized set of error variants that can be used
by transport implementations, while still allowing for transport-specific
error types through the Other variant.
Variants§
Io(Error)
I/O operation failed
Closed
Transport connection is closed
ConnectionLimit(String)
Connection limit exceeded
InvalidConnection(String)
Invalid connection reference
SessionError(String)
Session management error
Format
Message formatting or framing error
Timeout
Connection timeout
BufferOverflow
Buffer overflow or resource exhaustion
MessageTooLarge
Message size exceeds maximum allowed
IncompleteMessage
Incomplete message received
ParseError(String)
JSON parsing error
SerializationError(String)
JSON serialization error
Other
Transport-specific error
Implementations§
Source§impl TransportError
impl TransportError
Sourcepub fn buffer_overflow(details: impl Into<String>) -> Self
pub fn buffer_overflow(details: impl Into<String>) -> Self
Create a buffer overflow error with details
Sourcepub fn message_too_large(size: usize, max_size: usize) -> Self
pub fn message_too_large(size: usize, max_size: usize) -> Self
Create a message too large error
Sourcepub fn incomplete_message() -> Self
pub fn incomplete_message() -> Self
Create an incomplete message error
Sourcepub fn parse_error(error: impl Into<String>) -> Self
pub fn parse_error(error: impl Into<String>) -> Self
Create a parse error
Sourcepub fn serialization_error(error: impl Into<String>) -> Self
pub fn serialization_error(error: impl Into<String>) -> Self
Create a serialization error
Sourcepub fn other(details: impl Into<String>) -> Self
pub fn other(details: impl Into<String>) -> Self
Create a transport-specific error with details
Sourcepub fn connection_limit(message: impl Into<String>) -> Self
pub fn connection_limit(message: impl Into<String>) -> Self
Create a connection limit error
Sourcepub fn invalid_connection(message: impl Into<String>) -> Self
pub fn invalid_connection(message: impl Into<String>) -> Self
Create an invalid connection error
Sourcepub fn session_error(message: impl Into<String>) -> Self
pub fn session_error(message: impl Into<String>) -> Self
Create a session error
Trait Implementations§
Source§impl Debug for TransportError
impl Debug for TransportError
Source§impl Display for TransportError
impl Display for TransportError
Source§impl Error for TransportError
impl Error for TransportError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<Error> for TransportError
impl From<Error> for TransportError
Source§impl From<TransportError> for IntegrationError
impl From<TransportError> for IntegrationError
Source§fn from(source: TransportError) -> Self
fn from(source: TransportError) -> Self
Source§impl From<TransportError> for McpError
impl From<TransportError> for McpError
Source§fn from(err: TransportError) -> Self
fn from(err: TransportError) -> Self
Auto Trait Implementations§
impl Freeze for TransportError
impl !RefUnwindSafe for TransportError
impl Send for TransportError
impl Sync for TransportError
impl Unpin for TransportError
impl !UnwindSafe for TransportError
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
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.