pub struct ParserBuilder { /* private fields */ }Expand description
Builder for a reusable ReferenceParser.
Implementations§
Source§impl ParserBuilder
impl ParserBuilder
Sourcepub fn alias(self, alias: impl Into<String>, book: Book) -> ParserBuilder
pub fn alias(self, alias: impl Into<String>, book: Book) -> ParserBuilder
Register a language-neutral alias that takes precedence over bundled data.
Sourcepub fn language_alias(
self,
language: Language,
alias: impl Into<String>,
book: Book,
) -> ParserBuilder
pub fn language_alias( self, language: Language, alias: impl Into<String>, book: Book, ) -> ParserBuilder
Register an alias that is available only for one language.
Sourcepub fn preferred_languages(
self,
languages: impl IntoIterator<Item = Language>,
) -> ParserBuilder
pub fn preferred_languages( self, languages: impl IntoIterator<Item = Language>, ) -> ParserBuilder
Set languages that should rank before the built-in automatic order.
Sourcepub const fn ambiguity_policy(self, policy: AmbiguityPolicy) -> ParserBuilder
pub const fn ambiguity_policy(self, policy: AmbiguityPolicy) -> ParserBuilder
Set the ambiguity policy.
Sourcepub fn build(self) -> Result<ReferenceParser, ParseError>
pub fn build(self) -> Result<ReferenceParser, ParseError>
Validate configuration and construct a reusable parser.
Trait Implementations§
Source§impl Clone for ParserBuilder
impl Clone for ParserBuilder
Source§fn clone(&self) -> ParserBuilder
fn clone(&self) -> ParserBuilder
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 ParserBuilder
impl Debug for ParserBuilder
Source§impl Default for ParserBuilder
impl Default for ParserBuilder
Source§fn default() -> ParserBuilder
fn default() -> ParserBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ParserBuilder
impl RefUnwindSafe for ParserBuilder
impl Send for ParserBuilder
impl Sync for ParserBuilder
impl Unpin for ParserBuilder
impl UnsafeUnpin for ParserBuilder
impl UnwindSafe for ParserBuilder
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