Struct websocket::header::LinkValue

source ·
pub struct LinkValue { /* private fields */ }
Expand description

A single link-value of a Link header, based on: RFC5988

Implementations§

source§

impl LinkValue

source

pub fn new<T>(uri: T) -> LinkValue
where T: Into<Cow<'static, str>>,

Create LinkValue from URI-Reference.

Get the LinkValue’s value.

source

pub fn rel(&self) -> Option<&[RelationType]>

Get the LinkValue’s rel parameter(s).

source

pub fn anchor(&self) -> Option<&str>

Get the LinkValue’s anchor parameter.

source

pub fn rev(&self) -> Option<&[RelationType]>

Get the LinkValue’s rev parameter(s).

source

pub fn href_lang(&self) -> Option<&[LanguageTag]>

Get the LinkValue’s hreflang parameter(s).

source

pub fn media_desc(&self) -> Option<&[MediaDesc]>

Get the LinkValue’s media parameter(s).

source

pub fn title(&self) -> Option<&str>

Get the LinkValue’s title parameter.

source

pub fn title_star(&self) -> Option<&str>

Get the LinkValue’s title* parameter.

source

pub fn media_type(&self) -> Option<&Mime>

Get the LinkValue’s type parameter.

source

pub fn push_rel(self, rel: RelationType) -> LinkValue

Add a RelationType to the LinkValue’s rel parameter.

source

pub fn set_anchor<T>(self, anchor: T) -> LinkValue
where T: Into<String>,

Set LinkValue’s anchor parameter.

source

pub fn push_rev(self, rev: RelationType) -> LinkValue

Add a RelationType to the LinkValue’s rev parameter.

source

pub fn push_href_lang(self, language_tag: LanguageTag) -> LinkValue

Add a LanguageTag to the LinkValue’s hreflang parameter.

source

pub fn push_media_desc(self, media_desc: MediaDesc) -> LinkValue

Add a MediaDesc to the LinkValue’s media_desc parameter.

source

pub fn set_title<T>(self, title: T) -> LinkValue
where T: Into<String>,

Set LinkValue’s title parameter.

source

pub fn set_title_star<T>(self, title_star: T) -> LinkValue
where T: Into<String>,

Set LinkValue’s title* parameter.

source

pub fn set_media_type(self, media_type: Mime) -> LinkValue

Set LinkValue’s type parameter.

Trait Implementations§

source§

impl Clone for LinkValue

source§

fn clone(&self) -> LinkValue

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LinkValue

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Display for LinkValue

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl PartialEq for LinkValue

source§

fn eq(&self, other: &LinkValue) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for LinkValue

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Typeable for T
where T: Any,

source§

fn get_type(&self) -> TypeId

Get the TypeId of this object.