pub enum Error {
Show 16 variants
InvalidEndpoint(String),
Connect(String),
ConnectTimeout,
Io(String),
Tls(String),
InsecureEndpointNotLoopback(SocketAddr),
ApplicationClosed(CloseInfo),
BadFrame,
BadFrameWithClose(CloseInfo),
BadPreamble,
BadPreambleWithClose(CloseInfo),
Rejected(String),
AckTimeout,
FullStreamTimeout,
VersionMismatch(u32),
MissingVersion,
}Expand description
Errors surfaced by the client.
Variants§
InvalidEndpoint(String)
Connect(String)
ConnectTimeout
Io(String)
Tls(String)
InsecureEndpointNotLoopback(SocketAddr)
An explicit insecure-local-dev constructor was given a non-loopback address. Unverified TLS is never permitted for a public endpoint.
ApplicationClosed(CloseInfo)
The peer terminated the connection with a Pulse application close.
BadFrame
A datagram or stream frame that did not match the documented layout.
BadFrameWithClose(CloseInfo)
A full-tx frame was truncated and the peer also supplied a terminal application close. Both signals matter: the close explains why the transport ended, while the framing error proves the final announced frame was incomplete.
BadPreamble
The full-tx stream’s opening bytes were not
thornode_pulse_wire::frame::PREAMBLE. The peer is not serving wire
v2, or the stream was corrupted in transit. This remains distinct from
BadFrame so callers can identify a protocol mismatch at setup.
BadPreambleWithClose(CloseInfo)
The full-tx preamble was incomplete or invalid and the peer also sent an application close. Both the protocol error and close context are preserved.
Rejected(String)
The server answered a control message with {"ok": false, ...}.
Carries the server’s stated reason.
AckTimeout
No complete control ack arrived within ACK_TIMEOUT. The subscribe
call returns this error instead of waiting indefinitely.
FullStreamTimeout
The server acknowledged a full-tx subscription but did not open and
preface its stream within FULL_STREAM_TIMEOUT.
VersionMismatch(u32)
The server’s first-control-message ack named a negotiated wire version this SDK does not speak. Carries the version the server chose.
MissingVersion
A successful first ack omitted v, leaving the datagram-only tier with
no proof that wire v2 was negotiated.
Implementations§
Source§impl Error
impl Error
Sourcepub fn close_info(&self) -> Option<&CloseInfo>
pub fn close_info(&self) -> Option<&CloseInfo>
Returns the terminal application close carried by this error, including a close that coincided with a truncated full-tx frame.
Sourcepub fn is_bad_frame(&self) -> bool
pub fn is_bad_frame(&self) -> bool
Whether this error reports malformed/truncated wire framing.
Sourcepub fn is_bad_preamble(&self) -> bool
pub fn is_bad_preamble(&self) -> bool
Whether this error reports an invalid or truncated full-tx preamble.
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
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()