Enum actix_web::cookie::time::format_description::FormatItem
source · #[non_exhaustive]
pub enum FormatItem<'a> {
Literal(&'a [u8]),
Component(Component),
Compound(&'a [FormatItem<'a>]),
Optional(&'a FormatItem<'a>),
First(&'a [FormatItem<'a>]),
}
cookies
only.Expand description
A complete description of how to format and parse a type.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Literal(&'a [u8])
Bytes that are formatted as-is.
Note: If you call the format
method that returns a String
, these bytes will be
passed through String::from_utf8_lossy
.
Component(Component)
A minimal representation of a single non-literal item.
Compound(&'a [FormatItem<'a>])
A series of literals or components that collectively form a partial or complete description.
Optional(&'a FormatItem<'a>)
A FormatItem
that may or may not be present when parsing. If parsing fails, there will be
no effect on the resulting struct
.
This variant has no effect on formatting, as the value is guaranteed to be present.
First(&'a [FormatItem<'a>])
A series of FormatItem
s where, when parsing, the first successful parse is used. When
formatting, the first element of the slice is used. An empty slice is a no-op when
formatting or parsing.
Trait Implementations§
source§impl<'a> Clone for FormatItem<'a>
impl<'a> Clone for FormatItem<'a>
source§fn clone(&self) -> FormatItem<'a>
fn clone(&self) -> FormatItem<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for FormatItem<'_>
impl Debug for FormatItem<'_>
source§impl<'a> From<&'a [FormatItem<'_>]> for FormatItem<'a>
impl<'a> From<&'a [FormatItem<'_>]> for FormatItem<'a>
source§fn from(items: &'a [FormatItem<'_>]) -> FormatItem<'a>
fn from(items: &'a [FormatItem<'_>]) -> FormatItem<'a>
source§impl From<Component> for FormatItem<'_>
impl From<Component> for FormatItem<'_>
source§fn from(component: Component) -> FormatItem<'_>
fn from(component: Component) -> FormatItem<'_>
source§impl PartialEq<&[FormatItem<'_>]> for FormatItem<'_>
impl PartialEq<&[FormatItem<'_>]> for FormatItem<'_>
source§fn eq(&self, rhs: &&[FormatItem<'_>]) -> bool
fn eq(&self, rhs: &&[FormatItem<'_>]) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<Component> for FormatItem<'_>
impl PartialEq<Component> for FormatItem<'_>
source§impl PartialEq<FormatItem<'_>> for &[FormatItem<'_>]
impl PartialEq<FormatItem<'_>> for &[FormatItem<'_>]
source§fn eq(&self, rhs: &FormatItem<'_>) -> bool
fn eq(&self, rhs: &FormatItem<'_>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<FormatItem<'_>> for Component
impl PartialEq<FormatItem<'_>> for Component
source§fn eq(&self, rhs: &FormatItem<'_>) -> bool
fn eq(&self, rhs: &FormatItem<'_>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'a> PartialEq<FormatItem<'a>> for FormatItem<'a>
impl<'a> PartialEq<FormatItem<'a>> for FormatItem<'a>
source§fn eq(&self, other: &FormatItem<'a>) -> bool
fn eq(&self, other: &FormatItem<'a>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl TryFrom<FormatItem<'_>> for Component
impl TryFrom<FormatItem<'_>> for Component
§type Error = DifferentVariant
type Error = DifferentVariant
source§fn try_from(
value: FormatItem<'_>
) -> Result<Component, <Component as TryFrom<FormatItem<'_>>>::Error>
fn try_from( value: FormatItem<'_> ) -> Result<Component, <Component as TryFrom<FormatItem<'_>>>::Error>
source§impl<'a> TryFrom<FormatItem<'a>> for &[FormatItem<'a>]
impl<'a> TryFrom<FormatItem<'a>> for &[FormatItem<'a>]
§type Error = DifferentVariant
type Error = DifferentVariant
source§fn try_from(
value: FormatItem<'a>
) -> Result<&[FormatItem<'a>], <&[FormatItem<'a>] as TryFrom<FormatItem<'a>>>::Error>
fn try_from( value: FormatItem<'a> ) -> Result<&[FormatItem<'a>], <&[FormatItem<'a>] as TryFrom<FormatItem<'a>>>::Error>
impl<'a> Eq for FormatItem<'a>
impl Formattable for FormatItem<'_>
impl Parsable for FormatItem<'_>
impl<'a> StructuralEq for FormatItem<'a>
impl<'a> StructuralPartialEq for FormatItem<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for FormatItem<'a>
impl<'a> Send for FormatItem<'a>
impl<'a> Sync for FormatItem<'a>
impl<'a> Unpin for FormatItem<'a>
impl<'a> UnwindSafe for FormatItem<'a>
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.