syntax::ast

Trait IsString

Source
pub trait IsString: AstToken {
    const RAW_PREFIX: &'static str;
    const MODE: Mode;

    // Provided methods
    fn is_raw(&self) -> bool { ... }
    fn quote_offsets(&self) -> Option<QuoteOffsets> { ... }
    fn text_range_between_quotes(&self) -> Option<TextRange> { ... }
    fn text_without_quotes(&self) -> &str { ... }
    fn open_quote_text_range(&self) -> Option<TextRange> { ... }
    fn close_quote_text_range(&self) -> Option<TextRange> { ... }
    fn escaped_char_ranges(
        &self,
        cb: &mut dyn FnMut(TextRange, Result<char, EscapeError>),
    ) { ... }
    fn map_range_up(&self, range: TextRange) -> Option<TextRange> { ... }
}

Required Associated Constants§

Source

const RAW_PREFIX: &'static str

Source

const MODE: Mode

Provided Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl IsString for ByteString

Source§

const RAW_PREFIX: &'static str = "br"

Source§

const MODE: Mode = Mode::ByteStr

Source§

impl IsString for CString

Source§

const RAW_PREFIX: &'static str = "cr"

Source§

const MODE: Mode = Mode::CStr

Source§

impl IsString for String

Source§

const RAW_PREFIX: &'static str = "r"

Source§

const MODE: Mode = Mode::Str