Enum StyleRole Copy item path Source pub enum StyleRole {
Show 15 variants Type,
Field,
Variant,
Key,
String,
Number,
Boolean,
Null,
Punctuation,
Index,
Metadata,
Sensitive,
Truncated,
Error,
Muted,
}Expand description Semantic role of an inspected element within output formatting.
Instead of hard-coding raw colors or escape codes in renderers, renderers
request styles by semantic role. Themes map these roles to concrete terminal
styles.
Type names (e.g. Server, User, Vec<i32>).
Field or property names in structs/records (e.g. host, port).
Enum variant names (e.g. Running, Some, Ok).
Map keys or dictionary entries (e.g. "host", "port").
String literal values (e.g. "127.0.0.1").
Numeric values (e.g. 42, 3.14, -12, 0xff).
Boolean values (true, false).
Unit or null-like values ((), None).
Structural punctuation (e.g. :, "", [], (), ::).
Collection element indices (e.g. [0], [1]).
Metadata annotations (e.g. [16 bytes], length indicators).
Sensitive or redacted values (e.g. [REDACTED]).
Truncation notices (e.g. … 997 more, <truncated>).
Error messages or error variants (e.g. Err, <cycle>).
Subdued or muted secondary text.
Total number of semantic roles.
Return an array of all semantic roles.
Returns the integer index corresponding to this role (0 to 14).
Performs copy-assignment from
source.
Read more Formats the value using the given formatter.
Read more Compares and returns the maximum of two values.
Read more Compares and returns the minimum of two values.
Read more Restrict a value to a certain interval.
Read more 🔬 This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range.
Read more This method returns an ordering between
self and
other values if one exists.
Read more Tests less than (for
self and
other) and is used by the
< operator.
Read more Tests less than or equal to (for
self and
other) and is used by the
<= operator.
Read more Tests greater than (for
self and
other) and is used by the
>
operator.
Read more Tests greater than or equal to (for
self and
other) and is used by
the
>= operator.
Read more Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from
self to
dest.
Read more Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From <T> for U chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more Uses borrowed data to replace owned data, usually by cloning.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.