Enum iref::Error[][src]

pub enum Error {
    InvalidEncoding,
    InvalidPercentEncoding,
    MissingScheme,
    InvalidScheme,
    InvalidAuthority,
    InvalidUserInfo,
    InvalidHost,
    InvalidPort,
    InvalidSegment,
    InvalidPath,
    InvalidQuery,
    InvalidFragment,
}
Expand description

Parsing errors.

These are the different errors raised when some part of an IRI or IRI reference has an invalid syntax or encoding.

Variants

InvalidEncoding

The input data is not a valid UTF-8 encoded string.

InvalidPercentEncoding

The IRI part support percent-encoding, but the input data as an invalid percent-encoded character. This can occur for instance while trying to parse a query with the invalid percent encoded character %9a: Query::try_from("Hello Error %9a").

MissingScheme

Occurs when one is trying to convert an IriRef with no scheme into an Iri, or when an IRI is parsed with no scheme.

InvalidScheme

Occurs when the parsed Scheme is not syntactically valid. Note that even in an IRI, only ASCII letters, digit and symbols +, - and . are allowed.

InvalidAuthority

Occurs when the parsed Authority is not syntactically valid.

InvalidUserInfo

Occurs when the parsed UserInfo part of an Authority is not syntactically valid. Note that the userinfo part cannot include the @ character.

InvalidHost

Occurs when the parsed Host part of an Authority is not syntactically valid. Note that the host part cannot include the : character.

InvalidPort

Occurs when the parsed Port part of an Authority is not syntactically valid. This part may only contain ASCII digits.

InvalidSegment

Occurs when a path Segment is not syntactically valid. A Path segment cannot contain any / except at the end to denote “open” segments.

InvalidPath

Occurs when a Path is not syntactically valid. A path cannot contain the characters ? and # delimitating the Query and Fragment parts.

InvalidQuery

Occurs when a Query part is not syntactically valid.

InvalidFragment

Occurs when a Fragment part is not syntactically valid.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

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

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

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

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.