Struct elastic_requests::Url [] [src]

pub struct Url<'a>(_);

A wrapper around an owned or borrowed url.

Methods from Deref<Target = Cow<'a, str>>

1.0.0
[src]

Extracts the owned data.

Clones the data if it is not already owned.

Examples

Calling into_owned on a Cow::Borrowed clones the underlying data and becomes a Cow::Owned:

use std::borrow::Cow;

let s = "Hello world!";
let cow = Cow::Borrowed(s);

assert_eq!(
  cow.into_owned(),
  Cow::Owned(String::from(s))
);

Calling into_owned on a Cow::Owned is a no-op:

use std::borrow::Cow;

let s = "Hello world!";
let cow: Cow<str> = Cow::Owned(String::from(s));

assert_eq!(
  cow.into_owned(),
  Cow::Owned(String::from(s))
);

Trait Implementations

impl<'a> Debug for Url<'a>
[src]

[src]

Formats the value using the given formatter.

impl<'a> PartialEq for Url<'a>
[src]

[src]

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

[src]

This method tests for !=.

impl<'a> Clone for Url<'a>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<'a> From<&'a str> for Url<'a>
[src]

[src]

Performs the conversion.

impl<'a> From<String> for Url<'a>
[src]

[src]

Performs the conversion.

impl<'a> Deref for Url<'a>
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.