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