#[non_exhaustive]pub enum PurlError {
TooLong,
Scheme,
Type,
Name,
Namespace,
QualifierKey,
DuplicateQualifier,
Subpath,
Encoding,
TeiIdentifier,
}Expand description
Why a string is not a Package URL.
Experimental: may change in a 0.x minor release.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
TooLong
The text, or its canonical form, is longer than MAX_PURL_BYTES.
Scheme
The scheme is missing or is not pkg.
Type
The type is missing, does not start with a letter, or has characters
other than ASCII letters, digits, . and -.
Name
The name is missing.
Namespace
A namespace segment decodes to text containing /.
QualifierKey
A qualifier key is empty, has characters other than ASCII letters,
digits, ., - and _, or does not start with a letter.
DuplicateQualifier
A qualifier key appears twice.
Subpath
A subpath segment decodes to text containing /.
Encoding
A % not followed by two hex digits, or decoded bytes that are not UTF-8.
TeiIdentifier
The identifier of a purl TEI is not unpadded Base64URL of UTF-8 text.
Trait Implementations§
impl Eq for PurlError
Source§impl Error for PurlError
impl Error for PurlError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
impl StructuralPartialEq for PurlError
Auto Trait Implementations§
impl Forget for PurlError
impl Freeze for PurlError
impl Move for PurlError
impl RefUnwindSafe for PurlError
impl Send for PurlError
impl Sync for PurlError
impl Unpin for PurlError
impl UnsafeUnpin for PurlError
impl UnwindSafe for PurlError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more