#[non_exhaustive]pub enum ConnectError {
MalformedPairingCode,
MalformedNodeId,
WeakSecret {
got: usize,
need: usize,
},
ChallengeFailed,
SameRole(Role),
OutOfOrder {
got: &'static str,
expected: &'static str,
},
Expired {
what: &'static str,
limit: Duration,
},
RateLimited,
NoOverlap(&'static str),
NotPaired,
Refused(PairingRefused),
SessionRefused(SessionRefused),
}Expand description
Anything that can go wrong in the pure protocol.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MalformedPairingCode
The pairing code does not match ^([0-9a-zA-Z]+-)?[0-9a-zA-Z]{4,}$, or the token
is shorter than its kind allows.
MalformedNodeId
A node identifier is not a legal identifier.
WeakSecret
A challenge or token carries less entropy than the specification requires.
ChallengeFailed
The challenge response did not match. Someone is in the middle, or the user mistyped.
SameRole(Role)
The two nodes cannot pair: two CEMs, or two RMs.
OutOfOrder
The step arrived out of order.
Expired
The fifteen-second budget ran out.
RateLimited
The server is already handling an attempt for this node.
S2C §2. Calculate clientHmacChallengeResponse: “pairing attempts must be
handled sequentially, such that each second only one pairing attempt can be
processed for a node.”
NoOverlap(&'static str)
The peer offered no version, protocol or algorithm in common.
NotPaired
No pairing exists for this pair of node identifiers, or the token is wrong.
Refused(PairingRefused)
The pairing server refused, with one of the reasons the specification enumerates.
A driver turns this into 400 with the body verbatim.
SessionRefused(SessionRefused)
The communication server refused a session, likewise.
Trait Implementations§
Source§impl Clone for ConnectError
impl Clone for ConnectError
Source§impl Debug for ConnectError
impl Debug for ConnectError
Source§impl Display for ConnectError
impl Display for ConnectError
impl Eq for ConnectError
Source§impl Error for ConnectError
impl Error for ConnectError
1.30.0 · 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
use the Display impl or to_string()
Source§impl From<ConnectError> for Error
Available on crate feature tokio only.
impl From<ConnectError> for Error
tokio only.Source§fn from(_: ConnectError) -> Self
fn from(_: ConnectError) -> Self
Source§impl From<ConnectError> for Error
Available on crate feature connect-client only.
impl From<ConnectError> for Error
connect-client only.Source§fn from(source: ConnectError) -> Self
fn from(source: ConnectError) -> Self
Source§impl PartialEq for ConnectError
impl PartialEq for ConnectError
impl StructuralPartialEq for ConnectError
Auto Trait Implementations§
impl Forget for ConnectError
impl Freeze for ConnectError
impl Move for ConnectError
impl RefUnwindSafe for ConnectError
impl Send for ConnectError
impl Sync for ConnectError
impl Unpin for ConnectError
impl UnsafeUnpin for ConnectError
impl UnwindSafe for ConnectError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
key and return true if they are equal.