Struct entity_tag::EntityTag [−][src]
pub struct EntityTag<'t> {
pub weak: bool,
// some fields omitted
}An entity tag, defined in RFC7232.
Fields
weak: boolWhether 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) -> Self[src]
Construct a new EntityTag without checking.
pub unsafe fn with_str_unchecked<S: ?Sized + AsRef<str>>(
weak: bool,
tag: &'t S
) -> Self[src]
weak: bool,
tag: &'t S
) -> Self
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<Self, EntityTagError>[src]
weak: bool,
tag: S
) -> Result<Self, EntityTagError>
Construct a new EntityTag.
pub fn with_str<S: ?Sized + AsRef<str>>(
weak: bool,
tag: &'t S
) -> Result<Self, EntityTagError>[src]
weak: bool,
tag: &'t S
) -> Result<Self, EntityTagError>
Construct a new EntityTag.
impl<'t> EntityTag<'t>[src]
pub fn from_string<S: AsRef<str> + Into<String>>(
etag: S
) -> Result<Self, EntityTagError>[src]
etag: S
) -> Result<Self, EntityTagError>
Parse and construct a new EntityTag from a String.
pub fn from_str<S: ?Sized + AsRef<str>>(
etag: &'t S
) -> Result<Self, EntityTagError>[src]
etag: &'t S
) -> Result<Self, EntityTagError>
Parse and construct a new EntityTag from a str.
pub fn from_data<S: ?Sized + AsRef<[u8]>>(data: &S) -> Self[src]
Construct a strong EntityTag.
pub fn from_file_meta(metadata: &Metadata) -> Self[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.
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,