pub trait CstFormatContext: FormatContext {
    type Language: Language;
    type Style: CommentStyle<Language = Self::Language>;
    type CommentRule: FormatRule<SourceComment<Self::Language>, Context = Self> + Default;

    // Required method
    fn comments(&self) -> &Comments<Self::Language>;
}
Expand description

The CstFormatContext is an extension of the CST unaware FormatContext and must be implemented by every language.

The context customizes the comments formatting and stores the comments of the CST.

Required Associated Types§

source

type Language: Language

source

type Style: CommentStyle<Language = Self::Language>

source

type CommentRule: FormatRule<SourceComment<Self::Language>, Context = Self> + Default

Rule for formatting comments.

Required Methods§

source

fn comments(&self) -> &Comments<Self::Language>

Returns a reference to the program’s comments.

Object Safety§

This trait is not object safe.

Implementors§