Struct elastic::client::requests::Url
[−]
pub struct Url<'a>(_);
A wrapper around an owned or borrowed url.
Methods from Deref<Target = Cow<'a, str>>
fn into_owned(self) -> <B as ToOwned>::Owned
1.0.0
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> From<String> for Url<'a>
impl<'a> From<&'a str> for Url<'a>
impl<'a> PartialEq<Url<'a>> for Url<'a>
impl<'a> Debug for Url<'a>
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter.
impl<'a> Deref for Url<'a>
type Target = Cow<'a, str>
The resulting type after dereferencing
fn deref(&self) -> &Cow<'a, str>
The method called to dereference a value