Struct urn::Urn[][src]

pub struct Urn { /* fields omitted */ }
Expand description

An RFC2141/8141 URN (Uniform Resource Name).

Note: the equivalence checks are done according to the specification, only taking the NID and NSS into account! If you need exact equivalence checks, consider comparing using Urn::as_str() as the key. Some namespaces may define additional lexical equivalence checks, these aren’t accounted for in this implementation.

Implementations

String representation of the current URN (Canonicized).

NID (Namespace identifier), the first part of the URN.

For example, in urn:ietf:rfc:2648, ietf is the namespace.

Set the NID (must be a valid NID).

NSS (Namespace-specific string) identifying the resource.

For example, in urn:ietf:rfc:2648, rfs:2648 is the NSS.

Set the namespace-specific string (must be a valid NSS and use percent-encoding).

r-component, following the ?+ character sequence, to be used for passing parameters to URN resolution services.

In urn:example:foo-bar-baz-qux?+CCResolve:cc=uk, CCResolve:cc=uk is the r-component.

Should not be used for equivalence checks. As of 2021, exact semantics are undefined.

Set the r-component (must be a valid r-component and use percent-encoding).

q-component, following the ?= character sequence. Has a similar function to the URL query string.

Should not be used for equivalence checks.

Set the q-component (must be a valid q-component and use percent-encoding).

f-component (fragment) following the # character at the end of the URN.

Should not be used for equivalence checks.

Set the f-component (must be a valid f-component and use percent-encoding).

Trait Implementations

Performs the conversion.

Performs the conversion.

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Formats the value using the given formatter. Read more

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

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

This method tests for !=.

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.

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.

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.