#[non_exhaustive]pub enum RithmicError {
ConnectionFailed(String),
ConnectionClosed,
SendFailed,
EmptyResponse,
ServerError(String),
}Expand description
Typed errors returned by all plant handle methods.
ⓘ
match handle.subscribe("ESH6", "CME").await {
Ok(resp) => { /* success */ }
Err(RithmicError::ConnectionClosed | RithmicError::SendFailed) => {
handle.abort();
// reconnect — see examples/reconnect.rs
}
Err(RithmicError::ServerError(msg)) => eprintln!("rejected: {msg}"),
Err(e) => eprintln!("{e}"),
}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.
ConnectionFailed(String)
WebSocket connection could not be established.
ConnectionClosed
The plant’s WebSocket connection is gone; pending requests will never complete.
SendFailed
WebSocket send failed after the request was registered.
EmptyResponse
Server returned an empty response where at least one was expected.
ServerError(String)
Protocol-level rejection from Rithmic (the rp_code text).
Trait Implementations§
Source§impl Clone for RithmicError
impl Clone for RithmicError
Source§fn clone(&self) -> RithmicError
fn clone(&self) -> RithmicError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RithmicError
impl Debug for RithmicError
Source§impl Display for RithmicError
impl Display for RithmicError
Source§impl Error for RithmicError
impl Error for RithmicError
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 RithmicError
impl RefUnwindSafe for RithmicError
impl Send for RithmicError
impl Sync for RithmicError
impl Unpin for RithmicError
impl UnsafeUnpin for RithmicError
impl UnwindSafe for RithmicError
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