#[non_exhaustive]pub enum CdpError {
WebSocket(String),
Remote {
code: i64,
message: String,
},
Decode(String),
Timeout {
elapsed: Duration,
what: &'static str,
},
Closed,
}Expand description
Errors a CdpClient can surface.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
WebSocket(String)
WebSocket transport failure (handshake, TLS, abrupt close, …).
Remote
CDP responded with {"error": {"code": …, "message": …}} for our
command. Carries the protocol-level details.
Fields
Decode(String)
Response decoded as JSON but didn’t match the typed R we asked
for. Wraps the underlying serde error.
Timeout
execute (or wait_for_event) blocked past its deadline.
Fields
Closed
The client was used after CdpClient::close (or the read loop
exited because the peer closed the connection).
Trait Implementations§
Source§impl Error for CdpError
impl Error for CdpError
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()
Auto Trait Implementations§
impl Freeze for CdpError
impl RefUnwindSafe for CdpError
impl Send for CdpError
impl Sync for CdpError
impl Unpin for CdpError
impl UnsafeUnpin for CdpError
impl UnwindSafe for CdpError
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