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
sourceimpl<'a> Clone for FormatItem<'a>
impl<'a> Clone for FormatItem<'a>
sourcefn clone(&self) -> FormatItem<'a>
fn clone(&self) -> FormatItem<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for FormatItem<'_>
impl Debug for FormatItem<'_>
sourceimpl<'a> From<&'a [FormatItem<'_>]> for FormatItem<'a>
impl<'a> From<&'a [FormatItem<'_>]> for FormatItem<'a>
sourcefn from(items: &'a [FormatItem<'_>]) -> FormatItem<'a>
fn from(items: &'a [FormatItem<'_>]) -> FormatItem<'a>
Converts to this type from the input type.
sourceimpl From<Component> for FormatItem<'_>
impl From<Component> for FormatItem<'_>
sourcefn from(component: Component) -> FormatItem<'_>
fn from(component: Component) -> FormatItem<'_>
Converts to this type from the input type.
sourceimpl PartialEq<&[FormatItem<'_>]> for FormatItem<'_>
impl PartialEq<&[FormatItem<'_>]> for FormatItem<'_>
sourcefn eq(&self, rhs: &&[FormatItem<'_>]) -> bool
fn eq(&self, rhs: &&[FormatItem<'_>]) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl PartialEq<Component> for FormatItem<'_>
impl PartialEq<Component> for FormatItem<'_>
sourceimpl PartialEq<FormatItem<'_>> for &[FormatItem<'_>]
impl PartialEq<FormatItem<'_>> for &[FormatItem<'_>]
sourcefn eq(&self, rhs: &FormatItem<'_>) -> bool
fn eq(&self, rhs: &FormatItem<'_>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl PartialEq<FormatItem<'_>> for Component
impl PartialEq<FormatItem<'_>> for Component
sourcefn eq(&self, rhs: &FormatItem<'_>) -> bool
fn eq(&self, rhs: &FormatItem<'_>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl<'a> PartialEq<FormatItem<'a>> for FormatItem<'a>
impl<'a> PartialEq<FormatItem<'a>> for FormatItem<'a>
sourcefn eq(&self, other: &FormatItem<'a>) -> bool
fn eq(&self, other: &FormatItem<'a>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl TryFrom<FormatItem<'_>> for Component
impl TryFrom<FormatItem<'_>> for Component
type Error = DifferentVariant
type Error = DifferentVariant
The type returned in the event of a conversion error.
sourcefn try_from(
value: FormatItem<'_>
) -> Result<Component, <Component as TryFrom<FormatItem<'_>>>::Error>
fn try_from(
value: FormatItem<'_>
) -> Result<Component, <Component as TryFrom<FormatItem<'_>>>::Error>
Performs the conversion.
sourceimpl<'a> TryFrom<FormatItem<'a>> for &[FormatItem<'a>]
impl<'a> TryFrom<FormatItem<'a>> for &[FormatItem<'a>]
type Error = DifferentVariant
type Error = DifferentVariant
The type returned in the event of a conversion error.
sourcefn 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>
Performs the conversion.
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<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,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,
impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more