pub struct ReferenceParser { /* private fields */ }Expand description
Parser for extracting cross-references from RST content
Implementations§
Source§impl ReferenceParser
impl ReferenceParser
Sourcepub fn register_role(&mut self, role: String, ref_type: ReferenceType)
pub fn register_role(&mut self, role: String, ref_type: ReferenceType)
Register a custom role mapping
Sourcepub fn parse_content(
&self,
content: &str,
docname: &str,
source_path: Option<String>,
) -> Vec<CrossReference>
pub fn parse_content( &self, content: &str, docname: &str, source_path: Option<String>, ) -> Vec<CrossReference>
Parse content and extract all cross-references
Sourcepub fn parse_line(
&self,
line: &str,
docname: &str,
line_num: usize,
source_path: Option<String>,
) -> Vec<CrossReference>
pub fn parse_line( &self, line: &str, docname: &str, line_num: usize, source_path: Option<String>, ) -> Vec<CrossReference>
Parse a single line and extract cross-references
Sourcepub fn get_reference_stats(
&self,
references: &[CrossReference],
) -> HashMap<String, usize>
pub fn get_reference_stats( &self, references: &[CrossReference], ) -> HashMap<String, usize>
Get statistics about parsed references
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ReferenceParser
impl RefUnwindSafe for ReferenceParser
impl Send for ReferenceParser
impl Sync for ReferenceParser
impl Unpin for ReferenceParser
impl UnwindSafe for ReferenceParser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more