pub trait SpanEncoder: Encoder {
    // Required methods
    fn encode_span(&mut self, span: Span);
    fn encode_symbol(&mut self, symbol: Symbol);
    fn encode_expn_id(&mut self, expn_id: ExpnId);
    fn encode_syntax_context(&mut self, syntax_context: SyntaxContext);
    fn encode_crate_num(&mut self, crate_num: CrateNum);
    fn encode_def_index(&mut self, def_index: DefIndex);
    fn encode_def_id(&mut self, def_id: DefId);
}
Expand description

This trait is used to allow encoder specific encodings of certain types. It is similar to rustc_type_ir’s TyEncoder.

Required Methods§

source

fn encode_span(&mut self, span: Span)

source

fn encode_symbol(&mut self, symbol: Symbol)

source

fn encode_expn_id(&mut self, expn_id: ExpnId)

source

fn encode_syntax_context(&mut self, syntax_context: SyntaxContext)

source

fn encode_crate_num(&mut self, crate_num: CrateNum)

As a local identifier, a CrateNum is only meaningful within its context, e.g. within a tcx. Therefore, make sure to include the context when encode a CrateNum.

source

fn encode_def_index(&mut self, def_index: DefIndex)

source

fn encode_def_id(&mut self, def_id: DefId)

Implementations on Foreign Types§

source§

impl SpanEncoder for FileEncoder

source§

fn encode_span(&mut self, span: Span)

source§

fn encode_symbol(&mut self, symbol: Symbol)

source§

fn encode_expn_id(&mut self, _expn_id: ExpnId)

source§

fn encode_syntax_context(&mut self, _syntax_context: SyntaxContext)

source§

fn encode_crate_num(&mut self, crate_num: CrateNum)

source§

fn encode_def_index(&mut self, _def_index: DefIndex)

source§

fn encode_def_id(&mut self, def_id: DefId)

Implementors§