pub enum ReplicationWireError {
Truncated {
need: usize,
have: usize,
},
SubprotocolMismatch {
got: u16,
},
DispatchMismatch {
got: u8,
expected: u8,
},
BadRole(u8),
BadErrorCode(u8),
InvalidUtf8,
}Expand description
Errors surfacing from the decode path. Mirrors the typed-error shape the rest of the substrate uses for fallible decoders.
Variants§
Truncated
Buffer is shorter than the encoded message demands.
Fields
SubprotocolMismatch
Subprotocol header doesn’t match SUBPROTOCOL_REDEX.
DispatchMismatch
Dispatch code doesn’t match the decoder being invoked, or
falls outside the reserved 0x20..=0x2F range entirely.
Fields
BadRole(u8)
role byte in a SyncHeartbeat is outside the 0..=3
range the four-state model pins.
BadErrorCode(u8)
error_code byte in a SyncNack is outside the 1..=4
range the typed-error variants pin.
InvalidUtf8
detail bytes in a SyncNack are not valid UTF-8.
Trait Implementations§
impl Eq for WireError
Source§impl Error for WireError
impl Error for WireError
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()
impl StructuralPartialEq for WireError
Auto Trait Implementations§
impl Freeze for WireError
impl RefUnwindSafe for WireError
impl Send for WireError
impl Sync for WireError
impl Unpin for WireError
impl UnsafeUnpin for WireError
impl UnwindSafe for WireError
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<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.