pub struct PassageParser { /* private fields */ }Expand description
A reusable parser for book, chapter, verse-list, and passage sequences.
Implementations§
Source§impl PassageParser
impl PassageParser
Sourcepub fn new() -> PassageParser
pub fn new() -> PassageParser
Construct a parser with bundled aliases and conventional shorthand.
Sourcepub fn from_reference_parser(reference_parser: ReferenceParser) -> PassageParser
pub fn from_reference_parser(reference_parser: ReferenceParser) -> PassageParser
Construct a passage parser around an existing reference parser.
Sourcepub fn with_single_chapter_books(
self,
books: impl IntoIterator<Item = Book>,
) -> PassageParser
pub fn with_single_chapter_books( self, books: impl IntoIterator<Item = Book>, ) -> PassageParser
Replace the books for which a bare number denotes a chapter-one verse.
Sourcepub const fn reference_parser(&self) -> &ReferenceParser
pub const fn reference_parser(&self) -> &ReferenceParser
Borrow the parser used for book-name resolution and reference parsing.
Sourcepub fn single_chapter_books(&self) -> &[Book]
pub fn single_chapter_books(&self) -> &[Book]
Return the books configured for bare-number verse shorthand.
Sourcepub fn is_single_chapter_book(&self, book: Book) -> bool
pub fn is_single_chapter_book(&self, book: Book) -> bool
Whether a book uses bare-number verse shorthand in this parser.
Sourcepub fn parse(&self, input: &str) -> Result<Passage, ParseError>
pub fn parse(&self, input: &str) -> Result<Passage, ParseError>
Parse a passage using automatic language detection.
Sourcepub fn parse_with_language(
&self,
input: &str,
language: Language,
) -> Result<Passage, ParseError>
pub fn parse_with_language( &self, input: &str, language: Language, ) -> Result<Passage, ParseError>
Parse a passage using one explicit book-name language.
Sourcepub fn parse_detailed(&self, input: &str) -> Result<Parsed<Passage>, ParseError>
pub fn parse_detailed(&self, input: &str) -> Result<Parsed<Passage>, ParseError>
Parse a passage and retain normalization and book-resolution metadata.
Sourcepub fn parse_detailed_with_language(
&self,
input: &str,
language: Language,
) -> Result<Parsed<Passage>, ParseError>
pub fn parse_detailed_with_language( &self, input: &str, language: Language, ) -> Result<Parsed<Passage>, ParseError>
Parse with an explicit language and retain resolution metadata.
Trait Implementations§
Source§impl Clone for PassageParser
impl Clone for PassageParser
Source§fn clone(&self) -> PassageParser
fn clone(&self) -> PassageParser
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PassageParser
impl Debug for PassageParser
Source§impl Default for PassageParser
impl Default for PassageParser
Source§fn default() -> PassageParser
fn default() -> PassageParser
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PassageParser
impl RefUnwindSafe for PassageParser
impl Send for PassageParser
impl Sync for PassageParser
impl Unpin for PassageParser
impl UnsafeUnpin for PassageParser
impl UnwindSafe for PassageParser
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