Struct rustdoc::clean::Attributes [−][src]
pub struct Attributes { pub doc_strings: Vec<DocFragment>, pub other_attrs: Vec<Attribute>, pub cfg: Option<Arc<Cfg>>, pub span: Option<Span>, pub links: Vec<(String, Option<DefId>, Option<String>)>, }
Fields
doc_strings: Vec<DocFragment>
other_attrs: Vec<Attribute>
cfg: Option<Arc<Cfg>>
span: Option<Span>
links: Vec<(String, Option<DefId>, Option<String>)>
map from Rust paths to resolved defs and potential URL fragments
Methods
impl Attributes
[src]
impl Attributes
fn extract_cfg(mi: &MetaItem) -> Option<&MetaItem>
[src]
fn extract_cfg(mi: &MetaItem) -> Option<&MetaItem>
Extracts the content from an attribute #[doc(cfg(content))]
.
fn extract_include(mi: &MetaItem) -> Option<(String, String)>
[src]
fn extract_include(mi: &MetaItem) -> Option<(String, String)>
Reads a MetaItem
from within an attribute, looks for whether it is a
#[doc(include="file")]
, and returns the filename and contents of the file as loaded from
its expansion.
pub fn has_doc_flag(&self, flag: &str) -> bool
[src]
pub fn has_doc_flag(&self, flag: &str) -> bool
pub fn from_ast(diagnostic: &Handler, attrs: &[Attribute]) -> Attributes
[src]
pub fn from_ast(diagnostic: &Handler, attrs: &[Attribute]) -> Attributes
pub fn doc_value<'a>(&'a self) -> Option<&'a str>
[src]
pub fn doc_value<'a>(&'a self) -> Option<&'a str>
Finds the doc
attribute as a NameValue and returns the corresponding
value found.
pub fn collapsed_doc_value(&self) -> Option<String>
[src]
pub fn collapsed_doc_value(&self) -> Option<String>
Finds all doc
attributes as NameValues and returns their corresponding values, joined
with newlines.
pub fn links(&self, krate: &CrateNum) -> Vec<(String, String)>
[src]
pub fn links(&self, krate: &CrateNum) -> Vec<(String, String)>
Get links as a vector
Cache must be populated before call
impl Attributes
[src]
impl Attributes
pub fn collapse_doc_comments(&mut self)
[src]
pub fn collapse_doc_comments(&mut self)
impl Attributes
[src]
impl Attributes
pub fn unindent_doc_comments(&mut self)
[src]
pub fn unindent_doc_comments(&mut self)
Trait Implementations
impl Clone for Attributes
[src]
impl Clone for Attributes
fn clone(&self) -> Attributes
[src]
fn clone(&self) -> Attributes
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Encodable for Attributes
[src]
impl Encodable for Attributes
fn encode<__S: Encoder>(&self, s: &mut __S) -> Result<(), __S::Error>
[src]
fn encode<__S: Encoder>(&self, s: &mut __S) -> Result<(), __S::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl Decodable for Attributes
[src]
impl Decodable for Attributes
fn decode<__D: Decoder>(d: &mut __D) -> Result<Attributes, __D::Error>
[src]
fn decode<__D: Decoder>(d: &mut __D) -> Result<Attributes, __D::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl PartialEq for Attributes
[src]
impl PartialEq for Attributes
fn eq(&self, other: &Attributes) -> bool
[src]
fn eq(&self, other: &Attributes) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Attributes) -> bool
[src]
fn ne(&self, other: &Attributes) -> bool
This method tests for !=
.
impl Eq for Attributes
[src]
impl Eq for Attributes
fn assert_receiver_is_total_eq(&self)
[src]
fn assert_receiver_is_total_eq(&self)
impl Debug for Attributes
[src]
impl Debug for Attributes
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for Attributes
[src]
impl Default for Attributes
fn default() -> Attributes
[src]
fn default() -> Attributes
Returns the "default value" for a type. Read more
impl Hash for Attributes
[src]
impl Hash for Attributes
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl AttributesExt for Attributes
[src]
impl AttributesExt for Attributes
ⓘImportant traits for ListAttributesIter<'a>fn lists<'a>(&'a self, name: &'a str) -> ListAttributesIter<'a>
[src]
fn lists<'a>(&'a self, name: &'a str) -> ListAttributesIter<'a>
Finds an attribute as List and returns the list of attributes nested inside.
impl Clean<Attributes> for [Attribute]
[src]
impl Clean<Attributes> for [Attribute]
fn clean(&self, cx: &DocContext) -> Attributes
[src]
fn clean(&self, cx: &DocContext) -> Attributes
Auto Trait Implementations
impl !Send for Attributes
impl !Send for Attributes
impl !Sync for Attributes
impl !Sync for Attributes