Skip to main content

RequestError

Enum RequestError 

Source
pub enum RequestError {
Show 15 variants InvalidValue { axis: &'static str, value: String, expected: String, }, AnalyzerNamedAsView { value: String, analyzer: &'static str, suggested_view: &'static str, }, ViewNeedsContent(ViewSpec), NeedsAnalyzer { item: &'static str, analyzer: &'static str, }, IgnoredWithoutObservation(IgnoredEntries), PopulationMismatch { held: IgnoredEntries, requested: IgnoredEntries, }, ScopeUnsupported { axis: ScopeAxis, reason: &'static str, }, ContentMismatch { held: AnalysisSet, requested: AnalysisSet, }, WatchScope, WatchContent, WatchCacheOnly, StaleOkCacheOff, RootMismatch { held: PathBuf, requested: PathBuf, }, DeliveryUnsupported { route: &'static str, reason: &'static str, }, ViewLimit { attempted: usize, limit: usize, },
}
Expand description

Why a request cannot be answered as asked.

Typed so a caller can match the refusal it can act on, and rendered by Self::message in the vocabulary of the surface the request came through.

Variants§

§

InvalidValue

A value did not match its axis’s grammar.

Fields

§axis: &'static str

The axis, as the requesting surface names it.

§value: String

The rejected value, as the grammar quotes it.

§expected: String

What the grammar accepts instead.

§

AnalyzerNamedAsView

An analyzer name was supplied where a report view was expected.

Fields

§value: String

The rejected token in the caller’s spelling.

§analyzer: &'static str

The analysis unit to request.

§suggested_view: &'static str

A canonical view of that analysis.

§

ViewNeedsContent(ViewSpec)

A view has no metadata-only projection, and the request enables no analyzer.

§

NeedsAnalyzer

A view or ordering key requires an analyzer the request did not enable.

Fields

§item: &'static str

Requested view or metric label.

§analyzer: &'static str

Analysis unit to add.

§

IgnoredWithoutObservation(IgnoredEntries)

A selection by ignored state over a scan that observes no .gitignore.

§

PopulationMismatch

A retained narrow population cannot answer a read of another population.

Fields

§held: IgnoredEntries

Population retained by the holder.

§requested: IgnoredEntries

Population this read selected.

§

ScopeUnsupported

A scan scope this build cannot honour, whatever the delivery.

Fields

§axis: ScopeAxis

Which axis, so each surface names it in its own words.

§reason: &'static str

The rule, one sentence, in the library’s field names.

§

ContentMismatch

A read asks for another analyzer set than the retained index holds.

Fields

§held: AnalysisSet

The analyzers the index was built with.

§requested: AnalysisSet

The analyzers the read asks for.

§

WatchScope

A watch was asked to narrow its scan scope.

§

WatchContent

A watch was asked to keep content analysis current.

§

WatchCacheOnly

A watch was asked to start from a snapshot nothing verifies.

§

StaleOkCacheOff

A stale answer was asked of a delivery that never reads the snapshot.

§

RootMismatch

An operation names another root than the retained index it would mutate.

Fields

§held: PathBuf

Root held by the index.

§requested: PathBuf

Root requested by the caller.

§

DeliveryUnsupported

A route cannot honor the requested execution policy.

Fields

§route: &'static str

The lifecycle that refuses it.

§reason: &'static str

The unsupported policy combination.

§

ViewLimit

A read names more views than one report may carry.

Fields

§attempted: usize

Views and omitted views the request carries.

§limit: usize

The most one report accepts.

Implementations§

Source§

impl RequestError

Source

pub fn message(&self, axes: &AxisNames) -> String

The refusal in the vocabulary of the surface axes describes.

Self::InvalidValue already carries its axis, named by the surface that parsed it, so axes names only the knobs the other refusals point at.

Trait Implementations§

Source§

impl Clone for RequestError

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RequestError

Source§

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

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

impl Display for RequestError

The library’s vocabulary, as AxisNames::default is: a refusal rendered without naming a surface belongs to a library caller, not to the command line.

Source§

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

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

impl Eq for RequestError

Source§

impl Error for RequestError

1.30.0 · 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
Source§

impl PartialEq for RequestError

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RequestError

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.