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 DocFragment
impl DocFragment
[src]
impl DocFragment
fn kind(&self) -> DocFragmentKind
[src]
fn kind(&self) -> DocFragmentKind
Trait Implementations
impl Clone for DocFragment
[src]
impl Clone for DocFragment
fn clone(&self) -> DocFragment
[src]
fn clone(&self) -> DocFragment
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 DocFragment
[src]
impl Encodable for DocFragment
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 DocFragment
[src]
impl Decodable for DocFragment
fn 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 DocFragment
fn eq(&self, other: &DocFragment) -> bool
[src]
fn eq(&self, other: &DocFragment) -> bool
This 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) -> bool
This method tests for !=
.
impl Eq for DocFragment
[src]
impl Eq for DocFragment
fn assert_receiver_is_total_eq(&self)
[src]
fn assert_receiver_is_total_eq(&self)
impl Debug for DocFragment
[src]
impl Debug for DocFragment
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 Hash for DocFragment
[src]
impl Hash for DocFragment
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<'a> FromIterator<&'a DocFragment> for String
[src]
impl<'a> FromIterator<&'a DocFragment> for String
fn 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 DocFragment
impl !Sync for DocFragment
impl !Sync for DocFragment