[][src]Enum async_coap_uri::UriType

pub enum UriType {
    Uri,
    UriNoAuthority,
    UriCannotBeABase,
    NetworkPath,
    AbsolutePath,
    RelativePath,
    Query,
    Fragment,
}

Enum describing the type of a URI.

Variants

Uri

An IETF-RFC3986 "URI", including both scheme and authority components; E.g. http://example.com/abcd

assert_eq!(UriType::Uri, uri_ref!("http://example.com/abcd").uri_type());

URI references with this type can borrowed as a &Uri.

UriNoAuthority

An IETF-RFC3986 "URI" that has a scheme but no authority component, where the path begins with a slash; E.g. unix:/run/foo.socket

assert_eq!(UriType::UriNoAuthority, uri_ref!("unix:/run/foo.socket").uri_type());

URI references with this type can borrowed as a &Uri.

UriCannotBeABase

An IETF-RFC3986 "URI" that has a scheme but no authority component, where the path does not start with a slash (/); E.g. tel:+1-555-867-5309

assert_eq!(UriType::UriCannotBeABase, uri_ref!("tel:+1-555-867-5309").uri_type());

URI references with this type can borrowed as a &Uri.

NetworkPath

An IETF-RFC3986 "network-path" that has an authority component but no scheme; E.g. //example.com/foo/bar?q

assert_eq!(UriType::NetworkPath, uri_ref!("//example.com/foo/bar").uri_type());

Note that according to IETF-RFC3986 this is a "relative-reference", but because it includes an authority this library considers it to be borrowable as a &Uri.

AbsolutePath

An IETF-RFC3986 "relative-reference" with a "path-absolute" and optionally a query and/or fragment; E.g. /foo/bar?q

assert_eq!(UriType::AbsolutePath, uri_ref!("/foo/bar?q").uri_type());

URI references with this type can borrowed as a &RelRef.

RelativePath

An IETF-RFC3986 "relative-reference" with a "path-rootless" and optionally a query and/or fragment; E.g. foo/bar?q

An empty URI reference has this type, but the path is guaranteed to have a non-zero length if a query or fragment is present.

assert_eq!(UriType::RelativePath, uri_ref!("foo/bar?q").uri_type());
assert_eq!(UriType::RelativePath, uri_ref!("").uri_type());

URI references with this type can borrowed as a &RelRef.

Query

An IETF-RFC3986 "relative-reference" with a "path-empty", a query, and optionally a fragment; E.g. ?q=blah, ?q=blah#foo-bar

assert_eq!(UriType::Query, uri_ref!("?q=blah").uri_type());
assert_eq!(UriType::Query, uri_ref!("?q=blah#foo-bar").uri_type());

URI references with this type can borrowed as a &RelRef.

Fragment

An IETF-RFC3986 "relative-reference" that includes only a fragment component; E.g. #foo-bar

assert_eq!(UriType::Fragment, uri_ref!("#foo-bar").uri_type());

URI references with this type can borrowed as a &RelRef.

Methods

impl UriType[src]

pub fn can_borrow_as_uri(&self) -> bool[src]

Returns true if this type can be borrowed as a [&Uri], false otherwise.

pub fn can_borrow_as_rel_ref(&self) -> bool[src]

Returns true if this type can be borrowed as a [&RelRef], false otherwise.

pub fn has_absolute_path(&self) -> bool[src]

Returns true if this type can be assumed to have an absolute path.

pub fn is_ietf_rfc3986_relative_reference(&self) -> bool[src]

Returns true if IETF-RFC3986 considers this type to be a "relative-reference".

pub fn cannot_be_a_base(&self) -> bool[src]

Returns true if this type cannot be used as a base when performing URI reference resolution.

Trait Implementations

impl Clone for UriType[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Copy for UriType[src]

impl Eq for UriType[src]

impl PartialEq<UriType> for UriType[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl Hash for UriType[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

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

impl Debug for UriType[src]

Auto Trait Implementations

impl Send for UriType

impl Unpin for UriType

impl Sync for UriType

impl UnwindSafe for UriType

impl RefUnwindSafe for UriType

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]