pub enum Error {
}
Expand description
Comprehensive error type for Hyperliquid operations
Variants§
Transport(String)
Transport layer errors (network, connection issues)
Serde(Error)
JSON serialization/deserialization errors
Auth(String)
Authentication errors (signature mismatch, wrong wallet)
RateLimit
Rate limiting errors with optional retry information
NonceWindow(String)
Nonce window violations (nonces must be within time window and unique)
BadRequest(String)
Bad request errors (client-side invalid payload)
Exchange(String)
Exchange-specific errors from Hyperliquid server
Timeout
Request timeout
Decode(String)
Message decoding/parsing errors
Invariant(&'static str)
Invariant violation (impossible state)
Http
HTTP errors with status code
UrlParse(ParseError)
URL parsing errors
Io(Error)
Standard IO errors
Implementations§
Source§impl Error
impl Error
Sourcepub fn rate_limit(retry_after: Option<u64>) -> Self
pub fn rate_limit(retry_after: Option<u64>) -> Self
Create a rate limit error
Sourcepub fn nonce_window(msg: impl Into<String>) -> Self
pub fn nonce_window(msg: impl Into<String>) -> Self
Create a nonce window error
Sourcepub fn bad_request(msg: impl Into<String>) -> Self
pub fn bad_request(msg: impl Into<String>) -> Self
Create a bad request error
Sourcepub fn from_reqwest(error: Error) -> Self
pub fn from_reqwest(error: Error) -> Self
Map reqwest errors to appropriate error types
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if error is retryable
Sourcepub fn is_rate_limited(&self) -> bool
pub fn is_rate_limited(&self) -> bool
Check if error is due to rate limiting
Sourcepub fn is_auth_error(&self) -> bool
pub fn is_auth_error(&self) -> bool
Check if error is due to authentication issues
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
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 !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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Separable for Twhere
T: Display,
impl<T> Separable for Twhere
T: Display,
Source§fn separate_by_policy(&self, policy: SeparatorPolicy<'_>) -> String
fn separate_by_policy(&self, policy: SeparatorPolicy<'_>) -> String
SeparatorPolicy
. Read moreSource§fn separate_with_commas(&self) -> String
fn separate_with_commas(&self) -> String
Source§fn separate_with_spaces(&self) -> String
fn separate_with_spaces(&self) -> String
Source§fn separate_with_dots(&self) -> String
fn separate_with_dots(&self) -> String
Source§fn separate_with_underscores(&self) -> String
fn separate_with_underscores(&self) -> String
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.