Struct ra_ap_ide_db::path_transform::PathTransform[][src]

pub struct PathTransform<'a> { /* fields omitted */ }
Expand description

PathTransform substitutes path in SyntaxNodes in bulk.

This is mostly useful for IDE code generation. If you paste some existing code into a new context (for example, to add method overrides to an impl block), you generally want to appropriately qualify the names, and sometimes you might want to substitute generic parameters as well:

mod x {
  pub struct A<V>;
  pub trait T<U> { fn foo(&self, _: U) -> A<U>; }
}

mod y {
  use x::T;

  impl T<()> for () {
     // If we invoke **Add Missing Members** here, we want to copy-paste `foo`.
     // But we want a slightly-modified version of it:
     fn foo(&self, _: ()) -> x::A<()> {}
  }
}

Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Cast a value to type U using CastTo.

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more