#[non_exhaustive]pub enum Error {
Show 14 variants
Http(Error),
Json(Error),
Url(ParseError),
Status {
status: u16,
message: String,
},
Yahoo {
symbol: String,
code: String,
description: String,
},
RateLimited,
Auth(String),
TickerMissing {
ticker: String,
reason: String,
},
TimezoneMissing(String),
PricesMissing {
ticker: String,
hint: String,
},
InvalidPeriod {
ticker: String,
reason: String,
},
UnexpectedResponse(String),
InvalidArgument(String),
Io(Error),
}Expand description
All errors produced by this crate.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Http(Error)
Underlying HTTP transport failure.
Json(Error)
JSON decoding failure.
Url(ParseError)
URL parsing failure.
Status
Yahoo returned a non-success status code.
Fields
Yahoo
Yahoo’s chart/v8 endpoint returned an explicit error payload.
Fields
RateLimited
We got a 429 from Yahoo and exhausted retry budget.
Auth(String)
Could not obtain an authenticated session (cookie + crumb).
TickerMissing
The ticker symbol is missing or delisted.
Fields
TimezoneMissing(String)
The ticker has no timezone info — usually means delisted.
PricesMissing
No price data returned for the requested period/interval.
Fields
InvalidPeriod
The requested period/interval combination is not allowed.
UnexpectedResponse(String)
A response field had an unexpected shape.
InvalidArgument(String)
A required argument was invalid.
Io(Error)
Catch-all for unexpected I/O.
Implementations§
Source§impl Error
impl Error
Sourcepub fn unexpected(msg: impl Display) -> Self
pub fn unexpected(msg: impl Display) -> Self
Construct an Error::UnexpectedResponse with a formatted message.
Sourcepub fn invalid(msg: impl Display) -> Self
pub fn invalid(msg: impl Display) -> Self
Construct an Error::InvalidArgument with a formatted message.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Source§impl From<ParseError> for Error
impl From<ParseError> for Error
Source§fn from(source: ParseError) -> Self
fn from(source: ParseError) -> Self
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more