pub trait ParserCallbacks<'input> {
// Provided method
fn handle_broken_link(
&mut self,
link: BrokenLink<'input>,
) -> Option<(CowStr<'input>, CowStr<'input>)> { ... }
}Expand description
Trait to customize Parser behavior with callbacks. See Parser::new_with_callbacks.
All methods have a default implementation, so you can choose which ones to override.
Provided Methods§
Sourcefn handle_broken_link(
&mut self,
link: BrokenLink<'input>,
) -> Option<(CowStr<'input>, CowStr<'input>)>
fn handle_broken_link( &mut self, link: BrokenLink<'input>, ) -> Option<(CowStr<'input>, CowStr<'input>)>
Potentially provide a custom definition for a broken link.
In case the parser encounters any potential links that have a broken
reference (e.g [foo] when there is no [foo]: entry at the bottom)
this callback will be called with information about the reference,
and the returned pair will be used as the link URL and title if it is not
None.
Trait Implementations§
Source§impl<'input> ParserCallbacks<'input> for Box<dyn ParserCallbacks<'input>>
impl<'input> ParserCallbacks<'input> for Box<dyn ParserCallbacks<'input>>
Source§fn handle_broken_link(
&mut self,
link: BrokenLink<'input>,
) -> Option<(CowStr<'input>, CowStr<'input>)>
fn handle_broken_link( &mut self, link: BrokenLink<'input>, ) -> Option<(CowStr<'input>, CowStr<'input>)>
Potentially provide a custom definition for a broken link. Read more