[][src]Enum rand::ErrorKind

pub enum ErrorKind {
    Unavailable,
    Unexpected,
    Transient,
    NotReady,
    // some variants omitted
}

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.

Methods

impl ErrorKind
[src]

pub fn should_retry(self) -> bool
[src]

True if this kind of error may resolve itself on retry.

See also should_wait().

pub fn should_wait(self) -> bool
[src]

True if we should retry but wait before retrying

This implies should_retry() is true.

pub fn description(self) -> &'static str
[src]

A description of this error kind

Trait Implementations

impl Copy for ErrorKind
[src]

impl Clone for ErrorKind
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Eq for ErrorKind
[src]

impl PartialEq<ErrorKind> for ErrorKind
[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl Debug for ErrorKind
[src]

Auto Trait Implementations

impl Send for ErrorKind

impl Sync for ErrorKind

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> FromCast for T
[src]

impl<T, U> Cast for T where
    U: FromCast<T>, 
[src]

impl<T> FromBits for T
[src]

impl<T, U> IntoBits for T where
    U: FromBits<T>, 
[src]