Skip to main content

DispatchError

Enum DispatchError 

Source
pub enum DispatchError {
    UnknownSignature(QualifiedName),
    NoImplementation(QualifiedName),
    NoneAvailable {
        sig: QualifiedName,
        skipped: Vec<String>,
    },
    Unusable {
        id: String,
        reason: String,
    },
    BadArgument {
        sig: QualifiedName,
        index: usize,
        errors: Vec<ValueError>,
    },
    TypeArity {
        sig: QualifiedName,
        expected: usize,
        got: usize,
    },
    BoundNotMet {
        sig: QualifiedName,
        param: Ident,
        arg: String,
        bound: String,
    },
    Arity {
        sig: QualifiedName,
        expected: usize,
        got: usize,
    },
    BadResult {
        id: String,
        sig: QualifiedName,
        errors: Vec<ValueError>,
    },
    Exec {
        id: String,
        source: ExecError,
    },
}
Expand description

Why a call did not reach an implementation at all.

Variants§

§

UnknownSignature(QualifiedName)

The workspace has no such signature.

§

NoImplementation(QualifiedName)

Nothing has been registered that proves it.

§

NoneAvailable

Everything that proves it is out of reach here.

Fields

§sig: QualifiedName

The signature being called.

§skipped: Vec<String>

Each candidate and why it was passed over.

§

Unusable

A specific implementation was asked for and cannot be used.

Fields

§id: String

The implementation that was named.

§reason: String

Why not.

§

BadArgument

The arguments were not what the signature takes.

Fields

§sig: QualifiedName

The signature being called.

§index: usize

Which argument.

§errors: Vec<ValueError>

What was wrong with it.

§

TypeArity

The wrong number of type arguments.

A generic proposition is a claim about every type at once, and a value has one type, so the call has to say which type it is at before anything can be checked against it.

Fields

§sig: QualifiedName

The signature being called.

§expected: usize

How many it takes.

§got: usize

How many were given.

§

BoundNotMet

A type argument that is not what its parameter is bounded by.

pick<T: Named> says something about every T that has a name, and nothing about one that does not, so it cannot be asked at one.

Fields

§sig: QualifiedName

The signature being called.

§param: Ident

The generic parameter.

§arg: String

The type it was given.

§bound: String

The bound it does not meet.

§

Arity

The wrong number of arguments.

Fields

§sig: QualifiedName

The signature being called.

§expected: usize

How many it takes.

§got: usize

How many were given.

§

BadResult

An implementation returned something that is not what it promised.

This is the one failure that never falls back. The point of checking both sides of the boundary is to catch a proof that does not prove what it claims, and quietly asking someone else would defeat it.

Fields

§id: String

The implementation at fault.

§sig: QualifiedName

What it claimed to prove.

§errors: Vec<ValueError>

How the result fell short.

§

Exec

Running it failed.

Fields

§id: String

The implementation that was run.

§source: ExecError

What went wrong.

Trait Implementations§

Source§

impl Debug for DispatchError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for DispatchError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for DispatchError

Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.