pub enum PubMedError {
ParseError(ParseError),
RequestError(Error),
InvalidQuery(String),
RateLimitExceeded,
ApiError {
status: u16,
message: String,
},
SearchLimitExceeded {
requested: usize,
maximum: usize,
},
HistorySessionError(String),
WebEnvNotAvailable,
}Expand description
Error types for PubMed client operations
Variants§
ParseError(ParseError)
Parsing error (XML, JSON, article not found, etc.)
RequestError(Error)
HTTP request failed
InvalidQuery(String)
Invalid query structure or parameters
RateLimitExceeded
API rate limit exceeded
ApiError
Generic API error with HTTP status code
SearchLimitExceeded
Search limit exceeded This error is returned when a search query requests more results than the maximum retrievable limit.
HistorySessionError(String)
History session expired or invalid This error is returned when the WebEnv session is no longer valid (typically after 1 hour).
WebEnvNotAvailable
WebEnv not available in search result This error is returned when attempting to use history server features but the search did not return WebEnv/query_key (e.g., usehistory=y was not specified).
Trait Implementations§
Source§impl Debug for PubMedError
impl Debug for PubMedError
Source§impl Display for PubMedError
impl Display for PubMedError
Source§impl Error for PubMedError
impl Error for PubMedError
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()
Source§impl From<Error> for PubMedError
impl From<Error> for PubMedError
Source§impl From<ParseError> for PubMedError
impl From<ParseError> for PubMedError
Source§fn from(source: ParseError) -> Self
fn from(source: ParseError) -> Self
Converts to this type from the input type.
Source§impl RetryableError for PubMedError
impl RetryableError for PubMedError
Source§fn is_retryable(&self) -> bool
fn is_retryable(&self) -> bool
Returns true if the error is transient and the operation should be retried
Source§fn retry_reason(&self) -> &str
fn retry_reason(&self) -> &str
Returns a human-readable description of why the error is/isn’t retryable
Auto Trait Implementations§
impl Freeze for PubMedError
impl !RefUnwindSafe for PubMedError
impl Send for PubMedError
impl Sync for PubMedError
impl Unpin for PubMedError
impl !UnwindSafe for PubMedError
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
§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>
Converts
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>
Converts
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,
§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.