pub enum ErrorKind {
Unavailable,
Unexpected,
Transient,
NotReady,
// some variants omitted
}
Expand description
Error kind which can be matched over.
Variants
Unavailable
Feature is not available; not recoverable.
This is the most permanent failure type and implies the error cannot be resolved simply by retrying (e.g. the feature may not exist in this build of the application or on the current platform).
Unexpected
General failure; there may be a chance of recovery on retry.
This is the catch-all kind for errors from known and unknown sources which do not have a more specific kind / handling method.
It is suggested to retry a couple of times or retry later when handling; some error sources may be able to resolve themselves, although this is not likely.
Transient
A transient failure which likely can be resolved or worked around.
This error kind exists for a few specific cases where it is known that the error likely can be resolved internally, but is reported anyway.
NotReady
Not ready yet: recommended to try again a little later.
This error kind implies the generator needs more time or needs some other part of the application to do something else first before it is ready for use; for example this may be used by external generators which require time for initialization.
Implementations
sourceimpl ErrorKind
impl ErrorKind
sourcepub fn should_retry(self) -> bool
pub fn should_retry(self) -> bool
True if this kind of error may resolve itself on retry.
See also should_wait()
.
sourcepub fn should_wait(self) -> bool
pub fn should_wait(self) -> bool
True if we should retry but wait before retrying
This implies should_retry()
is true.
sourcepub fn description(self) -> &'static str
pub fn description(self) -> &'static str
A description of this error kind
Trait Implementations
impl Copy for ErrorKind
impl Eq for ErrorKind
impl StructuralEq for ErrorKind
impl StructuralPartialEq for ErrorKind
Auto Trait Implementations
impl RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl UnwindSafe for ErrorKind
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more