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.

§

§

§

§

§

§

Source§

Source

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.

Source

If self contains a Span, it’ll be replaced with DUMMY_SP to prevent creating links on “empty content” (because of the attributes merge).

Source

Returns the css class expected by rustdoc for each Class.

Source

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: