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 Attributesfn 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) -> boolpub fn from_ast(diagnostic: &Handler, attrs: &[Attribute]) -> Attributes[src]
pub fn from_ast(diagnostic: &Handler, attrs: &[Attribute]) -> Attributespub 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 Attributespub fn collapse_doc_comments(&mut self)[src]
pub fn collapse_doc_comments(&mut self)impl Attributes[src]
impl Attributespub fn unindent_doc_comments(&mut self)[src]
pub fn unindent_doc_comments(&mut self)Trait Implementations
impl Clone for Attributes[src]
impl Clone for Attributesfn clone(&self) -> Attributes[src]
fn clone(&self) -> AttributesReturns 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 Attributesfn 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 Attributesfn 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 Attributesfn eq(&self, other: &Attributes) -> bool[src]
fn eq(&self, other: &Attributes) -> boolThis 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) -> boolThis method tests for !=.
impl Eq for Attributes[src]
impl Eq for Attributesfn assert_receiver_is_total_eq(&self)[src]
fn assert_receiver_is_total_eq(&self)impl Debug for Attributes[src]
impl Debug for Attributesfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Default for Attributes[src]
impl Default for Attributesfn default() -> Attributes[src]
fn default() -> AttributesReturns the "default value" for a type. Read more
impl Hash for Attributes[src]
impl Hash for Attributesfn 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) -> AttributesAuto Trait Implementations
impl !Send for Attributes
impl !Send for Attributesimpl !Sync for Attributes
impl !Sync for Attributes