pub enum Error {
NegotiationFailed(NegotiationError),
ProtocolViolation(String),
Timeout(TimeoutKind),
Transport(Box<dyn Error + Send + Sync>),
StreamRejected {
code: RejectCode,
reason: Option<String>,
},
SessionClosed,
Disconnected,
CapacityExceeded(&'static str),
Config(ConfigError),
Control(ControlError),
Codec(CodecError),
}Expand description
Errors that can occur during session operations.
Variants§
NegotiationFailed(NegotiationError)
Negotiation failed during session startup.
ProtocolViolation(String)
Protocol violation detected.
Timeout(TimeoutKind)
Operation timed out.
Transport(Box<dyn Error + Send + Sync>)
Transport-level error.
StreamRejected
Stream open request was rejected by the peer.
SessionClosed
Session has been closed.
Disconnected
Connection to peer was lost.
CapacityExceeded(&'static str)
Capacity limit reached.
Config(ConfigError)
Configuration error.
Control(ControlError)
Control protocol error.
Codec(CodecError)
Codec error during message encoding/decoding.
Implementations§
Source§impl Error
impl Error
Sourcepub fn protocol_violation(message: impl Into<String>) -> Self
pub fn protocol_violation(message: impl Into<String>) -> Self
Creates a protocol violation error.
Sourcepub const fn stream_rejected(code: RejectCode, reason: Option<String>) -> Self
pub const fn stream_rejected(code: RejectCode, reason: Option<String>) -> Self
Creates a stream rejected error.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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<CodecError> for Error
impl From<CodecError> for Error
Source§fn from(source: CodecError) -> Self
fn from(source: CodecError) -> Self
Converts to this type from the input type.
Source§impl From<ControlError> for Error
impl From<ControlError> for Error
Source§fn from(source: ControlError) -> Self
fn from(source: ControlError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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