pub struct SyntaxEdit { /* private fields */ }
Expand description
Represents a completed SyntaxEditor
operation.
Implementations§
source§impl SyntaxEdit
impl SyntaxEdit
sourcepub fn old_root(&self) -> &SyntaxNode
pub fn old_root(&self) -> &SyntaxNode
Root of the initial unmodified syntax tree.
sourcepub fn new_root(&self) -> &SyntaxNode
pub fn new_root(&self) -> &SyntaxNode
Root of the modified syntax tree.
sourcepub fn changed_elements(&self) -> &[SyntaxElement]
pub fn changed_elements(&self) -> &[SyntaxElement]
Which syntax elements in the modified syntax tree were inserted or modified as part of the edit.
Note that for syntax nodes, only the upper-most parent of a set of changes is included, not any child elements that may have been modified.
sourcepub fn find_annotation(&self, annotation: SyntaxAnnotation) -> &[SyntaxElement]
pub fn find_annotation(&self, annotation: SyntaxAnnotation) -> &[SyntaxElement]
Finds which syntax elements have been annotated with the given annotation.
Note that an annotation might not appear in the modified syntax tree if the syntax elements that were annotated did not make it into the final syntax tree.
Auto Trait Implementations§
impl Freeze for SyntaxEdit
impl !RefUnwindSafe for SyntaxEdit
impl !Send for SyntaxEdit
impl !Sync for SyntaxEdit
impl Unpin for SyntaxEdit
impl !UnwindSafe for SyntaxEdit
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more