pub struct DirectiveRoleParser { /* private fields */ }Expand description
Parser for extracting directives and roles from RST content
Implementations§
Source§impl DirectiveRoleParser
impl DirectiveRoleParser
Sourcepub fn extract_directives(&self, content: &str) -> Vec<ParsedDirective>
pub fn extract_directives(&self, content: &str) -> Vec<ParsedDirective>
Extracts all directives from the given content
Sourcepub fn extract_roles(&self, content: &str) -> Vec<ParsedRole>
pub fn extract_roles(&self, content: &str) -> Vec<ParsedRole>
Extracts all roles from the given content
Sourcepub fn parse_content(
&self,
content: &str,
) -> (Vec<ParsedDirective>, Vec<ParsedRole>)
pub fn parse_content( &self, content: &str, ) -> (Vec<ParsedDirective>, Vec<ParsedRole>)
Extracts both directives and roles from content
Sourcepub fn is_directive_line(line: &str) -> bool
pub fn is_directive_line(line: &str) -> bool
Validates that a line contains a properly formatted directive
Sourcepub fn contains_role(text: &str) -> bool
pub fn contains_role(text: &str) -> bool
Validates that text contains a role
Sourcepub fn count_directives(content: &str) -> usize
pub fn count_directives(content: &str) -> usize
Counts the number of directives in content
Sourcepub fn count_roles(content: &str) -> usize
pub fn count_roles(content: &str) -> usize
Counts the number of roles in content
Auto Trait Implementations§
impl Freeze for DirectiveRoleParser
impl RefUnwindSafe for DirectiveRoleParser
impl Send for DirectiveRoleParser
impl Sync for DirectiveRoleParser
impl Unpin for DirectiveRoleParser
impl UnwindSafe for DirectiveRoleParser
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