pub struct VectorData {
pub text: String,
pub tree: Tree,
pub path: PathBuf,
}
Expand description
A wrapper struct for AST vector data that owns the data that the AST vector references
Ideally we would just have the AST vector own the actual string and tree, but it makes things extremely messy with the borrow checker, so we have this wrapper struct that holds the owned data that the vector references. This gets tricky because the tree sitter library uses FFI so the lifetime references get even more mangled.
Fields§
§text: String
The text in the file
tree: Tree
The tree that was parsed using the text
path: PathBuf
The file path that the text corresponds to
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VectorData
impl RefUnwindSafe for VectorData
impl Send for VectorData
impl Sync for VectorData
impl Unpin for VectorData
impl UnwindSafe for VectorData
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