[][src]Struct rustdoc_highlight::Classifier

pub struct Classifier<'a> { /* fields omitted */ }

Processes a program (nested in the internal lexer), classifying strings of text by highlighting category (Class). Calls out to a Writer to write each span of text in sequence.

Methods

impl<'a> Classifier<'a>[src]

pub fn new(lexer: StringReader<'a>, source_map: &'a SourceMap) -> Classifier<'a>[src]

pub fn write_source<W: Writer>(
    &mut self,
    out: &mut W
) -> Result<(), HighlightError>
[src]

Exhausts the lexer writing the output into out.

The general structure for this method is to iterate over each token, possibly giving it an HTML span with a class specifying what flavor of token is used. All source code emission is done as slices from the source map, not from the tokens themselves, in order to stay true to the original source.

Auto Trait Implementations

impl<'a> Unpin for Classifier<'a>

impl<'a> !Send for Classifier<'a>

impl<'a> !Sync for Classifier<'a>

impl<'a> !RefUnwindSafe for Classifier<'a>

impl<'a> !UnwindSafe for Classifier<'a>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<E> SpecializationError for E[src]

impl<T> Erased for T[src]