Skip to main content

AttributeExt

Trait AttributeExt 

Source
pub trait AttributeExt: Debug + 'static {
    // Required methods
    fn doc_str_and_fragment_kind(
        &self,
    ) -> Option<(Symbol, DocFragmentKind, Span)>;
    fn doc_resolution_scope(&self) -> Option<AttrStyle>;
}

Required Methods§

Source

fn doc_str_and_fragment_kind(&self) -> Option<(Symbol, DocFragmentKind, Span)>

Returns the documentation and its kind if this is a doc comment or a sugared doc comment.

  • ///doc returns Some(("doc", CommentKind::Line)).
  • /** doc */ returns Some(("doc", CommentKind::Block)).
  • #[doc = "doc"] returns Some(("doc", CommentKind::Line)).
  • #[doc(...)] returns None.
Source

fn doc_resolution_scope(&self) -> Option<AttrStyle>

Returns outer or inner if this is a doc attribute or a sugared doc comment, otherwise None.

This is used in the case of doc comments on modules, to decide whether to resolve intra-doc links against the symbols in scope within the commented module (for inner doc) vs within its parent module (for outer doc).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§