pub struct SearchError { /* private fields */ }Expand description
The error a SearchProvider returns when a search fails.
It holds a kind, a message, and an optional cause. The search tool keeps the whole error as the source of the tool error it returns, so the cause stays in the error chain.
Implementations§
Source§impl SearchError
impl SearchError
Sourcepub fn new(kind: SearchErrorKind, message: impl Into<String>) -> SearchError
pub fn new(kind: SearchErrorKind, message: impl Into<String>) -> SearchError
Builds an error from a kind and a message alone.
Sourcepub fn with_source(
kind: SearchErrorKind,
message: impl Into<String>,
source: impl Error + Send + Sync + 'static,
) -> SearchError
pub fn with_source( kind: SearchErrorKind, message: impl Into<String>, source: impl Error + Send + Sync + 'static, ) -> SearchError
Builds an error whose cause is source.
Sourcepub fn kind(&self) -> SearchErrorKind
pub fn kind(&self) -> SearchErrorKind
Returns which part of the search failed.
Trait Implementations§
Source§impl Debug for SearchError
impl Debug for SearchError
Source§impl Display for SearchError
impl Display for SearchError
Source§impl Error for SearchError
impl Error for SearchError
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 !RefUnwindSafe for SearchError
impl !UnwindSafe for SearchError
impl Freeze for SearchError
impl Send for SearchError
impl Sync for SearchError
impl Unpin for SearchError
impl UnsafeUnpin for SearchError
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<E> ExternalError for E
impl<E> ExternalError for E
fn into_lua_err(self) -> Error
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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