[][src]Struct ra_ap_syntax::algo::SyntaxRewriter

pub struct SyntaxRewriter<'a> { /* fields omitted */ }

Implementations

impl<'a> SyntaxRewriter<'a>[src]

pub fn from_fn(
    f: impl Fn(&SyntaxElement) -> Option<SyntaxElement> + 'a
) -> SyntaxRewriter<'a>
[src]

pub fn delete<T: Clone + Into<SyntaxElement>>(&mut self, what: &T)[src]

pub fn replace<T: Clone + Into<SyntaxElement>>(&mut self, what: &T, with: &T)[src]

pub fn replace_with_many<T: Clone + Into<SyntaxElement>>(
    &mut self,
    what: &T,
    with: Vec<SyntaxElement>
)
[src]

pub fn replace_ast<T: AstNode>(&mut self, what: &T, with: &T)[src]

pub fn rewrite(&self, node: &SyntaxNode) -> SyntaxNode[src]

pub fn rewrite_ast<N: AstNode>(self, node: &N) -> N[src]

pub fn rewrite_root(&self) -> Option<SyntaxNode>[src]

Returns a node that encompasses all replacements to be done by this rewriter.

Passing the returned node to rewrite will apply all replacements queued up in self.

Returns None when there are no replacements.

Trait Implementations

impl<'_> AddAssign<SyntaxRewriter<'_>> for SyntaxRewriter<'_>[src]

impl<'_> Debug for SyntaxRewriter<'_>[src]

impl<'a> Default for SyntaxRewriter<'a>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for SyntaxRewriter<'a>

impl<'a> !Send for SyntaxRewriter<'a>

impl<'a> !Sync for SyntaxRewriter<'a>

impl<'a> Unpin for SyntaxRewriter<'a>

impl<'a> !UnwindSafe for SyntaxRewriter<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.