LinkHints

Struct LinkHints 

Source
pub struct LinkHints {
    pub allow: Vec<String>,
    pub formats: BTreeMap<String, LinkHintFormat>,
    pub accept_post: BTreeMap<String, LinkHintFormat>,
    pub accept_patch: Vec<String>,
    pub accept_ranges: Vec<String>,
    pub accept_prefer: Vec<String>,
    pub precondition_req: Vec<String>,
    pub auth_schemes: Vec<LinkHintAuthSchemes>,
    pub status: Option<String>,
}
Expand description

Representation of Link Hints from draft-ietf-httpapi-link-hint-01

Fields§

§allow: Vec<String>§formats: BTreeMap<String, LinkHintFormat>§accept_post: BTreeMap<String, LinkHintFormat>§accept_patch: Vec<String>§accept_ranges: Vec<String>§accept_prefer: Vec<String>§precondition_req: Vec<String>§auth_schemes: Vec<LinkHintAuthSchemes>§status: Option<String>

Implementations§

Source§

impl LinkHints

Source

pub fn with_allow<S>(self, value: S) -> Self
where S: ToString,

Specify an allow value.

Source

pub fn with_format<S, V>(self, format: S, value: V) -> Self

Specify a format value.

Source

pub fn with_accept_post<S, V>(self, format: S, value: V) -> Self

Specify an accept-post value.

Source

pub fn with_accept_patch<S>(self, value: S) -> Self
where S: ToString,

Specify an accept-patch value.

Source

pub fn with_accept_range<S>(self, value: S) -> Self
where S: ToString,

Specify an accept-range value.

Source

pub fn with_accept_prefer<S>(self, value: S) -> Self
where S: ToString,

Specify an accept-prefer value.

Source

pub fn with_precondition_req<S>(self, value: S) -> Self
where S: ToString,

Specify a precondition-req value.

Source

pub fn with_precondition_req_etag(self) -> Self

Specify a precondition-req value of “etag”.

Source

pub fn with_precondition_req_last_modified(self) -> Self

Specify a precondition-req value of “last-modified”.

Source

pub fn with_auth_scheme<V>(self, value: V) -> Self

Specify an auth-scheme value.

Source

pub fn with_status<S>(self, value: S) -> Self
where S: ToString,

Specify a status value.

Source

pub fn with_status_deprecated(self) -> Self

Specify a status value of “deprecated”.

Source

pub fn with_status_gone(self) -> Self

Specify a status value of “gone”.

Trait Implementations§

Source§

impl Debug for LinkHints

Source§

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

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

impl Default for LinkHints

Source§

fn default() -> LinkHints

Returns the “default value” for a type. Read more
Source§

impl Serialize for LinkHints

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.