pub trait Doc: Clone {
type Source: Content;
type Lang: Language;
// Required methods
fn get_lang(&self) -> &Self::Lang;
fn get_source(&self) -> &Self::Source;
fn get_source_mut(&mut self) -> &mut Self::Source;
fn clone_with_lang(&self, lang: Self::Lang) -> Self;
fn from_str(src: &str, lang: Self::Lang) -> Self;
// Provided method
fn parse(&self, old_tree: Option<&Tree>) -> Result<Tree, TSParseError> { ... }
}
Required Associated Types§
Required Methods§
fn get_lang(&self) -> &Self::Lang
fn get_source(&self) -> &Self::Source
fn get_source_mut(&mut self) -> &mut Self::Source
fn clone_with_lang(&self, lang: Self::Lang) -> Self
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.