Skip to main content

UriTemplateError

Enum UriTemplateError 

Source
pub enum UriTemplateError {
Show 24 variants SourceTooLong { actual: usize, maximum: usize, }, TooManyParts { maximum: usize, }, TooManyExpressions { maximum: usize, }, TooManyVariables { maximum: usize, }, VariableNameTooLong { actual: usize, maximum: usize, }, InvalidLiteral { offset: usize, }, UnclosedExpression { offset: usize, }, NestedExpression { offset: usize, }, UnexpectedCloseBrace { offset: usize, }, EmptyExpression { offset: usize, }, UnsupportedOperator { operator: char, offset: usize, }, InvalidVariable { offset: usize, }, InvalidPrefix { offset: usize, }, InvalidExpansionLimit { field: &'static str, actual: usize, maximum: usize, }, ValueTooLong { actual: usize, maximum: usize, }, TooManyCompositeItems { actual: usize, maximum: usize, }, ExpansionTooLarge { actual: usize, maximum: usize, }, PrefixAppliedToComposite { variable: String, }, DuplicateAssociativeKey { key: String, }, NonReversibleTemplate { reason: UriTemplateMatchRejection, }, NonScalarMatchValue { variable: String, }, AmbiguousEmptyScalar { variable: String, }, MatchInputTooLong { actual: usize, maximum: usize, }, PreescapedReservedMatchValue { variable: String, },
}
Expand description

One typed reason template parsing or expansion failed.

Variants§

§

SourceTooLong

Source text exceeded the fixed parser bound.

Fields

§actual: usize

Observed UTF-8 bytes.

§maximum: usize

Maximum UTF-8 bytes.

§

TooManyParts

Parsing would retain too many parts.

Fields

§maximum: usize

Maximum part count.

§

TooManyExpressions

Parsing would retain too many expressions.

Fields

§maximum: usize

Maximum expression count.

§

TooManyVariables

An expression exceeded its variable-specification bound.

Fields

§maximum: usize

Maximum variable specifications.

§

VariableNameTooLong

A variable name exceeded its byte bound.

Fields

§actual: usize

Observed UTF-8 bytes.

§maximum: usize

Maximum UTF-8 bytes.

§

InvalidLiteral

A literal used a character outside RFC 6570’s literal grammar.

Fields

§offset: usize

Byte offset in the source text.

§

UnclosedExpression

An expression opened without a matching closing brace.

Fields

§offset: usize

Byte offset of the opening brace.

§

NestedExpression

An expression attempted to nest another expression.

Fields

§offset: usize

Byte offset of the nested opening brace.

§

UnexpectedCloseBrace

A closing brace appeared outside an expression.

Fields

§offset: usize

Byte offset of the closing brace.

§

EmptyExpression

An expression did not contain a variable specification.

Fields

§offset: usize

Byte offset immediately after the opening brace.

§

UnsupportedOperator

An expression used an RFC-reserved, unsupported operator.

Fields

§operator: char

The reserved operator character.

§offset: usize

Byte offset of the operator.

§

InvalidVariable

A variable specification did not match the RFC 6570 grammar.

Fields

§offset: usize

Byte offset of the variable specification.

§

InvalidPrefix

A prefix modifier did not match the RFC’s positive four-digit grammar.

Fields

§offset: usize

Byte offset of the prefix modifier.

§

InvalidExpansionLimit

A caller tried to relax a fixed expansion limit or selected zero.

Fields

§field: &'static str

The invalid configuration field.

§actual: usize

Requested value.

§maximum: usize

Fixed ceiling.

§

ValueTooLong

A supplied scalar, list member, map key, or map value was too large.

Fields

§actual: usize

Observed UTF-8 bytes.

§maximum: usize

Configured maximum UTF-8 bytes.

§

TooManyCompositeItems

Expansion would inspect too many composite members.

Fields

§actual: usize

Observed total members.

§maximum: usize

Configured maximum members.

§

ExpansionTooLarge

Expansion output would exceed the configured byte bound.

Fields

§actual: usize

Bytes that would be present after the append.

§maximum: usize

Configured maximum output bytes.

§

PrefixAppliedToComposite

A prefix modifier was applied to a non-scalar value.

Fields

§variable: String

The affected variable name.

§

DuplicateAssociativeKey

An associative value supplied the same key more than once.

Fields

§key: String

The repeated key.

§

NonReversibleTemplate

A template is valid RFC 6570 syntax but has no deterministic inverse.

Fields

§reason: UriTemplateMatchRejection

The specific reason compilation was rejected.

§

NonScalarMatchValue

A reversible expansion received a list or associative value.

Fields

§variable: String

The variable that requires a scalar value.

§

AmbiguousEmptyScalar

An empty simple or reserved scalar is indistinguishable from undefined.

Fields

§variable: String

The affected variable name.

§

MatchInputTooLong

A candidate URI exceeded the fixed reverse-match input bound.

Fields

§actual: usize

Observed UTF-8 bytes.

§maximum: usize

Fixed maximum UTF-8 bytes.

§

PreescapedReservedMatchValue

A reversible reserved or fragment value contained a pre-escaped triplet.

Fields

§variable: String

The affected variable name.

Trait Implementations§

Source§

impl Clone for UriTemplateError

Source§

fn clone(&self) -> UriTemplateError

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 UriTemplateError

Source§

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

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

impl Display for UriTemplateError

Source§

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

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

impl Eq for UriTemplateError

Source§

impl Error for UriTemplateError

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 UriTemplateError

Source§

fn eq(&self, other: &UriTemplateError) -> 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 UriTemplateError

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, _span: NoopSpan) -> Self

Instruments this future with a span (no-op when disabled).
Source§

fn in_current_span(self) -> Self

Instruments this future with the current span (no-op when disabled).
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V