Trait Doc

Source
pub trait Doc: Clone + 'static {
    type Source: Content;
    type Lang: Language;
    type Node<'r>: SgNode<'r>;

    // Required methods
    fn get_lang(&self) -> &Self::Lang;
    fn get_source(&self) -> &Self::Source;
    fn do_edit(&mut self, edit: &Edit<Self::Source>) -> Result<(), String>;
    fn root_node(&self) -> Self::Node<'_>;
    fn get_node_text<'a>(&'a self, node: &Self::Node<'a>) -> Cow<'a, str>;
}

Required Associated Types§

Required Methods§

Source

fn get_lang(&self) -> &Self::Lang

Source

fn get_source(&self) -> &Self::Source

Source

fn do_edit(&mut self, edit: &Edit<Self::Source>) -> Result<(), String>

Source

fn root_node(&self) -> Self::Node<'_>

Source

fn get_node_text<'a>(&'a self, node: &Self::Node<'a>) -> Cow<'a, str>

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<L: LanguageExt> Doc for StrDoc<L>

Source§

type Source = String

Source§

type Lang = L

Source§

type Node<'r> = Node<'r>