pub struct PatchBuilder<'a> {
pub db: &'a dyn SyntaxGroup,
/* private fields */
}
Fields§
§db: &'a dyn SyntaxGroup
Implementations§
source§impl<'a> PatchBuilder<'a>
impl<'a> PatchBuilder<'a>
sourcepub fn new(db: &'a dyn SyntaxGroup, origin: &impl TypedSyntaxNode) -> Self
pub fn new(db: &'a dyn SyntaxGroup, origin: &impl TypedSyntaxNode) -> Self
Creates a new patch builder, originating from origin
typed node.
sourcepub fn new_ex(db: &'a dyn SyntaxGroup, origin: &SyntaxNode) -> Self
pub fn new_ex(db: &'a dyn SyntaxGroup, origin: &SyntaxNode) -> Self
Creates a new patch builder, originating from origin
node.
sourcepub fn build(self) -> (String, Vec<CodeMapping>)
pub fn build(self) -> (String, Vec<CodeMapping>)
Builds the resulting code and code mappings.
sourcepub fn into_rewrite_node(self) -> RewriteNode
pub fn into_rewrite_node(self) -> RewriteNode
Builds the patcher into a rewrite node enabling adding it to other patchers.
pub fn add_char(&mut self, c: char)
pub fn add_str(&mut self, s: &str)
pub fn add_modified(&mut self, node: RewriteNode)
pub fn add_node(&mut self, node: SyntaxNode)
Auto Trait Implementations§
impl<'a> Freeze for PatchBuilder<'a>
impl<'a> !RefUnwindSafe for PatchBuilder<'a>
impl<'a> !Send for PatchBuilder<'a>
impl<'a> !Sync for PatchBuilder<'a>
impl<'a> Unpin for PatchBuilder<'a>
impl<'a> !UnwindSafe for PatchBuilder<'a>
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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