rustdoc::clean::types

Trait AttributesExt

Source
pub(crate) trait AttributesExt {
    type AttributeIterator<'a>: Iterator<Item = MetaItemInner>
       where Self: 'a;
    type Attributes<'a>: Iterator<Item = &'a Attribute>
       where Self: 'a;

    // Required methods
    fn lists(&self, name: Symbol) -> Self::AttributeIterator<'_>;
    fn iter(&self) -> Self::Attributes<'_>;

    // Provided method
    fn cfg(
        &self,
        tcx: TyCtxt<'_>,
        hidden_cfg: &FxHashSet<Cfg>,
    ) -> Option<Arc<Cfg>> { ... }
}

Required Associated Types§

Source

type AttributeIterator<'a>: Iterator<Item = MetaItemInner> where Self: 'a

Source

type Attributes<'a>: Iterator<Item = &'a Attribute> where Self: 'a

Required Methods§

Source

fn lists(&self, name: Symbol) -> Self::AttributeIterator<'_>

Source

fn iter(&self) -> Self::Attributes<'_>

Provided Methods§

Source

fn cfg(&self, tcx: TyCtxt<'_>, hidden_cfg: &FxHashSet<Cfg>) -> Option<Arc<Cfg>>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl AttributesExt for [(Cow<'_, Attribute>, Option<DefId>)]

Source§

type AttributeIterator<'a> = impl Iterator<Item = MetaItemInner> + 'a where Self: 'a

Source§

type Attributes<'a> = impl Iterator<Item = &'a Attribute> + 'a where Self: 'a

Source§

fn lists(&self, name: Symbol) -> Self::AttributeIterator<'_>

Source§

fn iter(&self) -> Self::Attributes<'_>

Source§

impl AttributesExt for [Attribute]

Source§

type AttributeIterator<'a> = impl Iterator<Item = MetaItemInner> + 'a

Source§

type Attributes<'a> = impl Iterator<Item = &'a Attribute> + 'a

Source§

fn lists(&self, name: Symbol) -> Self::AttributeIterator<'_>

Source§

fn iter(&self) -> Self::Attributes<'_>

Implementors§