pub enum Error {
InvalidApiKey,
InvalidInput(String),
Accounting(String),
Transport(String),
Provider {
status: u16,
code: Option<String>,
message: String,
},
Protocol(String),
SpendingLimitReached {
period: LimitPeriod,
limit: Money,
spent: Money,
},
}Expand description
A local validation, accounting, transport, provider, or protocol failure.
Variants§
InvalidApiKey
The API key was empty or invalid as an HTTP header.
InvalidInput(String)
The caller supplied an invalid request.
Accounting(String)
The in-memory session accounting state could not be used.
Transport(String)
The Gemini service could not be reached or timed out.
Provider
Gemini rejected the request.
Fields
Protocol(String)
A successful HTTP response did not satisfy the Gemini protocol.
SpendingLimitReached
A local spending window has reached its configured limit.
Trait Implementations§
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)>
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 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
Mutably borrows from an owned value. Read more