Struct iri_string::absolute::AbsoluteIri [] [src]

pub struct AbsoluteIri { /* fields omitted */ }

Absolute IRI and resolved URI.

Comparations (PartialEq, Eq, PartialOrd, Ord, Hash implementations) are done by raw IRI comparison (returned by [AbsoluteIri::raw]), not by resolved one (returned by [AbsoluteIri::resolved]).

Methods

impl AbsoluteIri
[src]

[src]

Creates a new AbsoluteIri.

Examples

let s = "https://例.example.com/example/テスト";
assert!(AbsoluteIri::new(s).is_ok());
assert!(AbsoluteIri::new("not-absolute-iri").is_err());

[src]

Returns raw IRI string slice.

Examples

let s = "https://例.example.com/example/テスト";
let iri = AbsoluteIri::new(s).expect("Should never fail");
assert_eq!(iri.raw(), s);

[src]

Returns reference to the resolved URI.

Examples

let s = "https://例.example.com/example/テスト";
let resolved = "https://xn--fsq.example.com/example/%E3%83%86%E3%82%B9%E3%83%88";
let iri = AbsoluteIri::new(s).expect("Should never fail");
assert_eq!(iri.resolved().as_str(), resolved);

[src]

Deconstructs AbsoluteIri into [AbsoluteIriString] and [Url].

Examples

let s = "https://例.example.com/example/テスト";
let resolved_str = "https://xn--fsq.example.com/example/%E3%83%86%E3%82%B9%E3%83%88";

let iri = AbsoluteIri::new(s).expect("Should never fail");
let (raw, resolved) = iri.deconstruct();
assert_eq!(raw, s);
assert_eq!(resolved.as_str(), resolved_str);

Trait Implementations

impl Debug for AbsoluteIri
[src]

[src]

Formats the value using the given formatter. Read more

impl Clone for AbsoluteIri
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq for AbsoluteIri
[src]

[src]

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

1.0.0
[src]

This method tests for !=.

impl Eq for AbsoluteIri
[src]

impl PartialOrd for AbsoluteIri
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Ord for AbsoluteIri
[src]

[src]

This method returns an Ordering between self and other. Read more

1.21.0
[src]

Compares and returns the maximum of two values. Read more

1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl Hash for AbsoluteIri
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

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

impl Serialize for AbsoluteIri
[src]

[src]

Serialize this value into the given Serde serializer. Read more

impl<'de> Deserialize<'de> for AbsoluteIri
[src]

[src]

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations

impl Send for AbsoluteIri

impl Sync for AbsoluteIri