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
pub fn trait_impl(
target_scope: &'a SemanticsScope<'a>,
source_scope: &'a SemanticsScope<'a>,
trait_: Trait,
impl_: Impl
) -> PathTransform<'a>
pub fn function_call(
target_scope: &'a SemanticsScope<'a>,
source_scope: &'a SemanticsScope<'a>,
function: Function,
generic_arg_list: GenericArgList
) -> PathTransform<'a>
Auto Trait Implementations
impl<'a> !RefUnwindSafe for PathTransform<'a>
impl<'a> !Send for PathTransform<'a>
impl<'a> !Sync for PathTransform<'a>
impl<'a> Unpin for PathTransform<'a>
impl<'a> !UnwindSafe for PathTransform<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more
fn cast<U>(self, interner: &<U as HasInterner>::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
fn cast<U>(self, interner: &<U as HasInterner>::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
Cast a value to type U
using CastTo
.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
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