#[repr(u8)]enum DateTimeToken {
Show 103 variants
a_d = 0,
A_D = 1,
a_m = 2,
A_M = 3,
ad = 4,
AD = 5,
am = 6,
AM = 7,
b_c = 8,
B_C = 9,
bc = 10,
BC = 11,
cc = 12,
CC = 13,
d = 14,
D = 15,
day = 16,
Day = 17,
DAY = 18,
dd = 19,
DD = 20,
ddd = 21,
DDD = 22,
dy = 23,
Dy = 24,
DY = 25,
fm = 26,
FM = 27,
fx = 28,
FX = 29,
hh = 30,
HH = 31,
hh12 = 32,
HH12 = 33,
hh24 = 34,
HH24 = 35,
i = 36,
I = 37,
id = 38,
ID = 39,
iddd = 40,
IDDD = 41,
iw = 42,
IW = 43,
iy = 44,
IY = 45,
iyy = 46,
IYY = 47,
iyyy = 48,
IYYY = 49,
j = 50,
J = 51,
mi = 52,
MI = 53,
mm = 54,
MM = 55,
mon = 56,
Mon = 57,
MON = 58,
month = 59,
Month = 60,
MONTH = 61,
ms = 62,
MS = 63,
OF = 64,
p_m = 65,
P_M = 66,
pm = 67,
PM = 68,
q = 69,
Q = 70,
rm = 71,
RM = 72,
ss = 73,
SS = 74,
ssss = 75,
SSSS = 76,
sssss = 77,
SSSSS = 78,
tz = 79,
TZ = 80,
TZH = 81,
TZM = 82,
us = 83,
US = 84,
w = 85,
W = 86,
ww = 87,
WW = 88,
y_yyy = 89,
Y_YYY = 90,
y = 91,
Y = 92,
yy = 93,
YY = 94,
yyy = 95,
YYY = 96,
yyyy = 97,
YYYY = 98,
th = 99,
TH = 100,
EscQuote = 101,
Quote = 102,
}
Expand description
The raw tokens that can appear in a format string. Many of these tokens overlap, in which case the longest matching token should be selected.
Variants§
a_d = 0
A_D = 1
a_m = 2
A_M = 3
ad = 4
AD = 5
am = 6
AM = 7
b_c = 8
B_C = 9
bc = 10
BC = 11
cc = 12
CC = 13
d = 14
D = 15
day = 16
Day = 17
DAY = 18
dd = 19
DD = 20
ddd = 21
DDD = 22
dy = 23
Dy = 24
DY = 25
fm = 26
FM = 27
fx = 28
FX = 29
hh = 30
HH = 31
hh12 = 32
HH12 = 33
hh24 = 34
HH24 = 35
i = 36
I = 37
id = 38
ID = 39
iddd = 40
IDDD = 41
iw = 42
IW = 43
iy = 44
IY = 45
iyy = 46
IYY = 47
iyyy = 48
IYYY = 49
j = 50
J = 51
mi = 52
MI = 53
mm = 54
MM = 55
mon = 56
Mon = 57
MON = 58
month = 59
Month = 60
MONTH = 61
ms = 62
MS = 63
OF = 64
p_m = 65
P_M = 66
pm = 67
PM = 68
q = 69
Q = 70
rm = 71
RM = 72
ss = 73
SS = 74
ssss = 75
SSSS = 76
sssss = 77
SSSSS = 78
tz = 79
TZ = 80
TZH = 81
TZM = 82
us = 83
US = 84
w = 85
W = 86
ww = 87
WW = 88
y_yyy = 89
Y_YYY = 90
y = 91
Y = 92
yy = 93
YY = 94
yyy = 95
YYY = 96
yyyy = 97
YYYY = 98
th = 99
TH = 100
EscQuote = 101
Quote = 102
Implementations§
Source§impl DateTimeToken
impl DateTimeToken
Sourceconst fn pattern(&self) -> &'static str
const fn pattern(&self) -> &'static str
Returns the literal sequence of characters that this DateTimeToken
matches.
Sourcefn patterns() -> Vec<&'static str>
fn patterns() -> Vec<&'static str>
Returns the list of all known patterns, in the same order as the enum variants.
Sourcefn field(&self) -> Option<DateTimeField>
fn field(&self) -> Option<DateTimeField>
Returns the DateTimeField
associated with this token, if any.
Some tokens do not correspond directly to a field, but instead modify other fields.
Sourcefn as_literal(&self) -> &'static str
fn as_literal(&self) -> &'static str
Returns how this token should be rendered if it appears within quotes.
This is usually the same string as the pattern
method returns, but
not always.
Sourcefn is_fill_mode_toggle(&self) -> bool
fn is_fill_mode_toggle(&self) -> bool
Returns whether this token is a fill mode toggle.
Sourcefn ordinal_mode(&self) -> OrdinalMode
fn ordinal_mode(&self) -> OrdinalMode
Returns how this token affects the ordinal mode, if at all.
Trait Implementations§
Source§impl From<DateTimeToken> for u8
impl From<DateTimeToken> for u8
Source§fn from(enum_value: DateTimeToken) -> Self
fn from(enum_value: DateTimeToken) -> Self
Source§impl PartialEq for DateTimeToken
impl PartialEq for DateTimeToken
Source§impl Sequence for DateTimeToken
impl Sequence for DateTimeToken
Source§impl TryFrom<u8> for DateTimeToken
impl TryFrom<u8> for DateTimeToken
Source§type Error = TryFromPrimitiveError<DateTimeToken>
type Error = TryFromPrimitiveError<DateTimeToken>
Source§impl TryFromPrimitive for DateTimeToken
impl TryFromPrimitive for DateTimeToken
const NAME: &'static str = "DateTimeToken"
type Primitive = u8
type Error = TryFromPrimitiveError<DateTimeToken>
fn try_from_primitive( number: Self::Primitive, ) -> Result<Self, TryFromPrimitiveError<Self>>
impl Eq for DateTimeToken
impl StructuralPartialEq for DateTimeToken
Auto Trait Implementations§
impl Freeze for DateTimeToken
impl RefUnwindSafe for DateTimeToken
impl Send for DateTimeToken
impl Sync for DateTimeToken
impl Unpin for DateTimeToken
impl UnwindSafe for DateTimeToken
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
Source§impl<T, U> OverrideFrom<Option<&T>> for Uwhere
U: OverrideFrom<T>,
impl<T, U> OverrideFrom<Option<&T>> for Uwhere
U: OverrideFrom<T>,
Source§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
Source§fn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
RustType::from_proto
.Source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
RustType::into_proto
.Source§impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
Source§fn plus_equals(&mut self, rhs: &&'a S)
fn plus_equals(&mut self, rhs: &&'a S)
std::ops::AddAssign
, for types that do not implement AddAssign
.