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]
impl<'t> EntityTag<'t>
[src]pub const HEADER_NAME: &'static str
[src]
ETag
impl<'t> EntityTag<'t>
[src]
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]
impl<'t> EntityTag<'t>
[src]pub fn from_string<S: AsRef<str> + Into<String>>(
etag: S
) -> Result<EntityTag<'static>, EntityTagError>
[src]
etag: S
) -> Result<EntityTag<'static>, 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) -> 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]
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> StructuralEq for EntityTag<'t>
[src]
impl<'t> StructuralEq for EntityTag<'t>
[src]impl<'t> StructuralPartialEq for EntityTag<'t>
[src]
impl<'t> StructuralPartialEq for EntityTag<'t>
[src]Auto Trait Implementations
impl<'t> RefUnwindSafe for EntityTag<'t>
impl<'t> RefUnwindSafe for EntityTag<'t>
impl<'t> UnwindSafe for EntityTag<'t>
impl<'t> UnwindSafe for EntityTag<'t>