Class in rustdoc::html::highlight - Rust (original) (raw)
enum Class {
Show 18 variants Comment,
DocComment,
Attribute,
KeyWord,
RefKeyWord,
Self_(Span),
Macro(Span),
MacroNonTerminal,
String,
Number,
Bool,
Ident(Span),
Lifetime,
PreludeTy(Span),
PreludeVal(Span),
QuestionMark,
Decoration(&'static str),
Backline(u32),
}
Expand description
How a span of text is classified. Mostly corresponds to token kinds.
Keywords that do pointer/reference stuff.
Ident
isn’t rendered in the HTML but we still need it for the Span
it contains.
It is only looking at the variant, not the variant content.
It is used mostly to group multiple similar HTML elements into one <span>
instead of multiple ones.
If self
contains a Span
, it’ll be replaced with DUMMY_SP
to prevent creating links on “empty content” (because of the attributes merge).
Returns the css class expected by rustdoc for each Class
.
In case this is an item which can be converted into a link to a definition, it’ll contain a “span” (a tuple representing (lo, hi)
equivalent of Span
).
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 24 bytes
Size for each variant:
Comment
: 0 bytesDocComment
: 0 bytesAttribute
: 0 bytesKeyWord
: 0 bytesRefKeyWord
: 0 bytesSelf_
: 8 bytesMacro
: 8 bytesMacroNonTerminal
: 0 bytesString
: 0 bytesNumber
: 0 bytesBool
: 0 bytesIdent
: 8 bytesLifetime
: 0 bytesPreludeTy
: 8 bytesPreludeVal
: 8 bytesQuestionMark
: 0 bytesDecoration
: 20 bytesBackline
: 4 bytes