pub struct AstNodeWrapper<Wrapped, Tag> {
pub wrapped: Wrapped,
pub tag: PhantomData<Tag>,
}
Expand description
A newtype around an AST node that implements the traits above if the node implements them.
Fields§
§wrapped: Wrapped
§tag: PhantomData<Tag>
Implementations§
source§impl<Wrapped, Tag> AstNodeWrapper<Wrapped, Tag>
impl<Wrapped, Tag> AstNodeWrapper<Wrapped, Tag>
pub fn new(wrapped: Wrapped, _tag: Tag) -> AstNodeWrapper<Wrapped, Tag>
Trait Implementations§
source§impl<Wrapped, Tag> AstDeref for AstNodeWrapper<Wrapped, Tag>
impl<Wrapped, Tag> AstDeref for AstNodeWrapper<Wrapped, Tag>
source§impl<Wrapped: Debug, Tag> Debug for AstNodeWrapper<Wrapped, Tag>
impl<Wrapped: Debug, Tag> Debug for AstNodeWrapper<Wrapped, Tag>
source§impl<N: DummyAstNode, T: DummyAstNode> DummyAstNode for AstNodeWrapper<N, T>
impl<N: DummyAstNode, T: DummyAstNode> DummyAstNode for AstNodeWrapper<N, T>
Auto Trait Implementations§
impl<Wrapped, Tag> DynSend for AstNodeWrapper<Wrapped, Tag>
impl<Wrapped, Tag> DynSync for AstNodeWrapper<Wrapped, Tag>
impl<Wrapped, Tag> Freeze for AstNodeWrapper<Wrapped, Tag>where
Wrapped: Freeze,
impl<Wrapped, Tag> RefUnwindSafe for AstNodeWrapper<Wrapped, Tag>where
Wrapped: RefUnwindSafe,
Tag: RefUnwindSafe,
impl<Wrapped, Tag> Send for AstNodeWrapper<Wrapped, Tag>
impl<Wrapped, Tag> Sync for AstNodeWrapper<Wrapped, Tag>
impl<Wrapped, Tag> Unpin for AstNodeWrapper<Wrapped, Tag>
impl<Wrapped, Tag> UnwindSafe for AstNodeWrapper<Wrapped, Tag>where
Wrapped: UnwindSafe,
Tag: UnwindSafe,
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> HasAttrs for T
impl<T> HasAttrs for T
source§const SUPPORTS_CUSTOM_INNER_ATTRS: bool = const SUPPORTS_CUSTOM_INNER_ATTRS: bool =
<T::Target>::SUPPORTS_CUSTOM_INNER_ATTRS;
const SUPPORTS_CUSTOM_INNER_ATTRS: bool = const SUPPORTS_CUSTOM_INNER_ATTRS: bool = <T::Target>::SUPPORTS_CUSTOM_INNER_ATTRS;
This is
true
if this HasAttrs
might support ‘custom’ (proc-macro) inner
attributes. Attributes like #![cfg]
and #![cfg_attr]
are not
considered ‘custom’ attributes. Read morefn attrs(&self) -> &[Attribute]
fn visit_attrs(&mut self, f: impl FnOnce(&mut ThinVec<Attribute>))
source§impl<T> HasTokens for T
impl<T> HasTokens for T
fn tokens(&self) -> Option<&LazyAttrTokenStream>
fn tokens_mut(&mut self) -> Option<&mut Option<LazyAttrTokenStream>>
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 moresource§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.