Struct ra_ap_ide_db::path_transform::PathTransform
source · [−]pub struct PathTransform<'a> { /* private fields */ }
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
sourceimpl<'a> PathTransform<'a>
impl<'a> PathTransform<'a>
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>
pub fn apply(&self, syntax: &SyntaxNode)
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Cast for T
impl<T> Cast for T
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
.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more