pub enum Error {
Io(Error),
Codec(Error),
Protocol(String),
FrameTooLarge {
len: usize,
max: usize,
},
VersionMismatch {
ours: u32,
theirs: u32,
},
Sync(String),
Closed,
Refused(String),
}Expand description
Errors raised by a session.
Variants§
Io(Error)
Reading or writing the stream failed.
Codec(Error)
A control frame’s JSON did not decode, or a message did not encode.
Protocol(String)
The peer sent something the framing or the session does not allow.
FrameTooLarge
A frame announced more payload than its kind allows: crate::MAX_FRAME_LEN for a
control frame, crate::CHUNK for a content chunk.
Fields
VersionMismatch
The peer speaks a session format this build does not.
Sync(String)
The replication core failed; the message is its error’s Display.
Closed
The writer is gone — the stream failed under it — so nothing more can be sent.
Refused(String)
The peer said it would not continue, and why.
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()
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Forget for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin 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