Struct entity_tag::EntityTag[][src]

pub struct EntityTag<'t> {
    pub weak: bool,
    // some fields omitted
}

An entity tag, defined in RFC7232.

Fields

weak: bool

Whether to have a weakness indicator.

Implementations

impl<'t> EntityTag<'t>[src]

pub const HEADER_NAME: &'static str[src]

ETag

impl<'t> EntityTag<'t>[src]

pub const unsafe fn new_unchecked(weak: bool, tag: Cow<'t, str>) -> Self[src]

Construct a new EntityTag without checking.

pub const fn get_tag_cow(&self) -> &Cow<'t, str>[src]

Get the tag. The double quotes are not included.

impl<'t> EntityTag<'t>[src]

pub unsafe fn with_string_unchecked<S: Into<String>>(
    weak: bool,
    tag: S
) -> EntityTag<'static>
[src]

Construct a new EntityTag without checking.

pub unsafe fn with_str_unchecked<S: ?Sized + AsRef<str>>(
    weak: bool,
    tag: &'t S
) -> Self
[src]

Construct a new EntityTag without checking.

impl<'t> EntityTag<'t>[src]

pub fn with_string<S: AsRef<str> + Into<String>>(
    weak: bool,
    tag: S
) -> Result<EntityTag<'static>, EntityTagError>
[src]

Construct a new EntityTag.

pub fn with_str<S: ?Sized + AsRef<str>>(
    weak: bool,
    tag: &'t S
) -> Result<Self, EntityTagError>
[src]

Construct a new EntityTag.

impl<'t> EntityTag<'t>[src]

pub fn from_string<S: AsRef<str> + Into<String>>(
    etag: S
) -> Result<EntityTag<'static>, EntityTagError>
[src]

Parse and construct a new EntityTag from a String.

pub fn from_str<S: ?Sized + AsRef<str>>(
    etag: &'t S
) -> Result<Self, EntityTagError>
[src]

Parse and construct a new EntityTag from a str.

pub fn from_data<S: ?Sized + AsRef<[u8]>>(data: &S) -> EntityTag<'static>[src]

Construct a strong EntityTag.

pub fn from_file_meta(metadata: &Metadata) -> EntityTag<'static>[src]

Construct a weak EntityTag.

impl<'t> EntityTag<'t>[src]

pub fn get_tag(&'t self) -> &'t str[src]

Get the tag. The double quotes are not included.

pub fn into_tag(self) -> Cow<'t, str>[src]

Into the tag. The double quotes are not included.

pub fn into_owned(self) -> EntityTag<'static>[src]

Extracts the owned data.

impl<'t> EntityTag<'t>[src]

pub fn strong_eq<'v>(&self, other: &EntityTag<'v>) -> bool[src]

For strong comparison two entity-tags are equivalent if both are not weak and their opaque-tags match character-by-character.

pub fn weak_eq<'v>(&self, other: &EntityTag<'v>) -> bool[src]

For weak comparison two entity-tags are equivalent if their opaque-tags match character-by-character, regardless of either or both being tagged as “weak”.

pub fn strong_ne<'v>(&self, other: &EntityTag<'v>) -> bool[src]

The inverse of strong_eq.

pub fn weak_ne<'v>(&self, other: &EntityTag<'v>) -> bool[src]

The inverse of weak_eq.

Trait Implementations

impl<'t> Clone for EntityTag<'t>[src]

impl<'t> Debug for EntityTag<'t>[src]

impl<'t> Display for EntityTag<'t>[src]

impl<'t> Eq for EntityTag<'t>[src]

impl<'t> PartialEq<EntityTag<'t>> for EntityTag<'t>[src]

impl<'t> StructuralEq for EntityTag<'t>[src]

impl<'t> StructuralPartialEq for EntityTag<'t>[src]

Auto Trait Implementations

impl<'t> RefUnwindSafe for EntityTag<'t>

impl<'t> Send for EntityTag<'t>

impl<'t> Sync for EntityTag<'t>

impl<'t> Unpin for EntityTag<'t>

impl<'t> UnwindSafe for EntityTag<'t>

Blanket Implementations

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

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.