Trait rustpython_literal::escape::Escape

source ·
pub trait Escape {
    // Required methods
    fn source_len(&self) -> usize;
    fn layout(&self) -> &EscapeLayout;
    fn write_source(&self, formatter: &mut impl Write) -> Result;
    fn write_body_slow(&self, formatter: &mut impl Write) -> Result;

    // Provided methods
    fn changed(&self) -> bool { ... }
    fn write_body(&self, formatter: &mut impl Write) -> Result { ... }
}

Required Methods§

source

fn source_len(&self) -> usize

source

fn layout(&self) -> &EscapeLayout

source

fn write_source(&self, formatter: &mut impl Write) -> Result

source

fn write_body_slow(&self, formatter: &mut impl Write) -> Result

Provided Methods§

source

fn changed(&self) -> bool

source

fn write_body(&self, formatter: &mut impl Write) -> Result

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a> Escape for AsciiEscape<'a>

source§

impl<'a> Escape for UnicodeEscape<'a>