pub enum Refusal {
SessionNotAccepting {
state: SessionState,
},
NotPermitted {
state: SessionState,
},
HandshakeIncomplete {
state: SessionState,
},
Unnegotiated {
state: SessionState,
},
}Expand description
A message the session would not admit, and why.
Separate from EngineError because nothing failed: the message was
understood, the session simply is not in a position to take it, and the
peer is owed a JSON-RPC error rather than a dropped connection. Every
variant carries the state that produced the refusal, because that is the
one fact an operator needs and the one a peer’s bug report will not have.
Variants§
SessionNotAccepting
The session is closing or closed, so nothing is admitted at all.
Checked before the lifecycle is consulted, so no protocol has to remember to re-implement the terminal case.
Fields
state: SessionStateWhere the session was.
NotPermitted
The protocol said this method is not permitted here.
Fields
state: SessionStateWhere the session was.
HandshakeIncomplete
The method is ordinary work and the session has not finished its handshake.
Fields
state: SessionStateWhere the session was.
Unnegotiated
Nothing has been negotiated, so there is no profile to gate against.
Distinct from HandshakeIncomplete because
the lifecycle may well have permitted the method and had no profile
to check it against. Reporting “not permitted” there would blame the
peer for a session that has not started.
Fields
state: SessionStateWhere the session was.
Implementations§
Trait Implementations§
impl Eq for Refusal
Source§impl Error for Refusal
impl Error for Refusal
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()