Struct ast_grep_core::source::StrDoc
source · pub struct StrDoc<L: Language> {
pub src: String,
pub lang: L,
}
Fields§
§src: String
§lang: L
Implementations§
Trait Implementations§
source§impl<L: Language> Doc for StrDoc<L>
impl<L: Language> Doc for StrDoc<L>
type Source = String
type Lang = L
fn get_lang(&self) -> &Self::Lang
fn get_source(&self) -> &Self::Source
fn get_source_mut(&mut self) -> &mut Self::Source
source§fn from_str(src: &str, lang: L) -> Self
fn from_str(src: &str, lang: L) -> Self
TODO: are we paying too much to support str as Pattern/Replacer??
this method converts string to Doc, so that we can support using
string as replacer/searcher. Natively.
fn parse(&self, old_tree: Option<&Tree>) -> Result<Tree, TSParseError>
Auto Trait Implementations§
impl<L> Freeze for StrDoc<L>where
L: Freeze,
impl<L> RefUnwindSafe for StrDoc<L>where
L: RefUnwindSafe,
impl<L> Send for StrDoc<L>where
L: Send,
impl<L> Sync for StrDoc<L>where
L: Sync,
impl<L> Unpin for StrDoc<L>where
L: Unpin,
impl<L> UnwindSafe for StrDoc<L>where
L: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more