Enum rustdoc::clean::DocFragment [−][src]
pub enum DocFragment {
SugaredDoc(usize, Span, String),
RawDoc(usize, Span, String),
Include(usize, Span, String, String),
}A portion of documentation, extracted from a #[doc] attribute.
Each variant contains the line number within the complete doc-comment where the fragment starts, as well as the Span where the corresponding doc comment or attribute is located.
Included files are kept separate from inline doc comments so that proper line-number information can be given when a doctest fails. Sugared doc comments and "raw" doc comments are kept separate because of issue #42760.
Variants
SugaredDoc(usize, Span, String)A doc fragment created from a /// or //! doc comment.
RawDoc(usize, Span, String)A doc fragment created from a "raw" #[doc=""] attribute.
Include(usize, Span, String, String)A doc fragment created from a #[doc(include="filename")] attribute. Contains both the
given filename and the file contents.
Methods
impl DocFragment[src]
impl DocFragmentimpl DocFragment[src]
impl DocFragmentfn kind(&self) -> DocFragmentKind[src]
fn kind(&self) -> DocFragmentKindTrait Implementations
impl Clone for DocFragment[src]
impl Clone for DocFragmentfn clone(&self) -> DocFragment[src]
fn clone(&self) -> DocFragmentReturns 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 DocFragment[src]
impl Encodable for DocFragmentfn 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 DocFragment[src]
impl Decodable for DocFragmentfn decode<__D: Decoder>(d: &mut __D) -> Result<DocFragment, __D::Error>[src]
fn decode<__D: Decoder>(d: &mut __D) -> Result<DocFragment, __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 DocFragment[src]
impl PartialEq for DocFragmentfn eq(&self, other: &DocFragment) -> bool[src]
fn eq(&self, other: &DocFragment) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &DocFragment) -> bool[src]
fn ne(&self, other: &DocFragment) -> boolThis method tests for !=.
impl Eq for DocFragment[src]
impl Eq for DocFragmentfn assert_receiver_is_total_eq(&self)[src]
fn assert_receiver_is_total_eq(&self)impl Debug for DocFragment[src]
impl Debug for DocFragmentfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Hash for DocFragment[src]
impl Hash for DocFragmentfn 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<'a> FromIterator<&'a DocFragment> for String[src]
impl<'a> FromIterator<&'a DocFragment> for Stringfn from_iter<T>(iter: T) -> Self where
T: IntoIterator<Item = &'a DocFragment>, [src]
fn from_iter<T>(iter: T) -> Self where
T: IntoIterator<Item = &'a DocFragment>, Creates a value from an iterator. Read more
Auto Trait Implementations
impl !Send for DocFragment
impl !Send for DocFragmentimpl !Sync for DocFragment
impl !Sync for DocFragment