pub enum DataSourceError {
ConnError(String),
FetchError(String),
SymbolNotFound(String),
InvalidTimeRange(String),
IoError(String),
ParseError(String),
RateLimited,
NotSupported(String),
}Expand description
Error types for data source operations.
All fallible DataSource methods return this error type. Use
is_recoverable to decide whether an
automatic retry is appropriate.
Variants§
ConnError(String)
Failed to connect to data source
FetchError(String)
Failed to fetch data
SymbolNotFound(String)
Symbol not found
InvalidTimeRange(String)
Invalid time range
IoError(String)
IO error (cannot be cloned, stores error message)
ParseError(String)
Parse error
RateLimited
Request was rate limited
NotSupported(String)
Feature not supported by this data source
Implementations§
Source§impl DataSourceError
impl DataSourceError
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
Check if this error is recoverable (can retry)
Sourcepub fn is_conn_error(&self) -> bool
pub fn is_conn_error(&self) -> bool
Check if this error is a conn-related error
Trait Implementations§
Source§impl Clone for DataSourceError
impl Clone for DataSourceError
Source§fn clone(&self) -> DataSourceError
fn clone(&self) -> DataSourceError
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 DataSourceError
impl Debug for DataSourceError
Source§impl Display for DataSourceError
impl Display for DataSourceError
Source§impl Error for DataSourceError
impl Error for DataSourceError
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 DataSourceError
impl RefUnwindSafe for DataSourceError
impl Send for DataSourceError
impl Sync for DataSourceError
impl Unpin for DataSourceError
impl UnsafeUnpin for DataSourceError
impl UnwindSafe for DataSourceError
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