Struct rustc_ast::ast_traits::AstNodeWrapper
source · 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
sourceimpl<Wrapped, Tag> AstNodeWrapper<Wrapped, Tag>
impl<Wrapped, Tag> AstNodeWrapper<Wrapped, Tag>
pub fn new(wrapped: Wrapped, _tag: Tag) -> AstNodeWrapper<Wrapped, Tag>
Trait Implementations
sourceimpl<Wrapped, Tag> AstDeref for AstNodeWrapper<Wrapped, Tag>
impl<Wrapped, Tag> AstDeref for AstNodeWrapper<Wrapped, Tag>
Auto Trait Implementations
impl<Wrapped, Tag> RefUnwindSafe for AstNodeWrapper<Wrapped, Tag>where
Tag: RefUnwindSafe,
Wrapped: RefUnwindSafe,
impl<Wrapped, Tag> Send for AstNodeWrapper<Wrapped, Tag>where
Tag: Send,
Wrapped: Send,
impl<Wrapped, Tag> Sync for AstNodeWrapper<Wrapped, Tag>where
Tag: Sync,
Wrapped: Sync,
impl<Wrapped, Tag> Unpin for AstNodeWrapper<Wrapped, Tag>where
Tag: Unpin,
Wrapped: Unpin,
impl<Wrapped, Tag> UnwindSafe for AstNodeWrapper<Wrapped, Tag>where
Tag: UnwindSafe,
Wrapped: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> HasAttrs for Twhere
T: AstDeref,
<T as AstDeref>::Target: HasAttrs,
impl<T> HasAttrs for Twhere
T: AstDeref,
<T as AstDeref>::Target: HasAttrs,
sourceconst 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>))
sourceimpl<T> HasTokens for Twhere
T: AstDeref,
<T as AstDeref>::Target: HasTokens,
impl<T> HasTokens for Twhere
T: AstDeref,
<T as AstDeref>::Target: HasTokens,
fn tokens(&self) -> Option<&LazyAttrTokenStream>
fn tokens_mut(&mut self) -> Option<&mut Option<LazyAttrTokenStream>>
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.