pub struct Configuration { /* private fields */ }
Expand description
Configuration for the parser.
A configuration to correctly parse a real wiki can be created with Configuration::new
. A configuration for testing and quick and dirty prototyping can be created with Default::default
.
Implementations§
Source§impl Configuration
impl Configuration
Sourcepub fn new(source: &ConfigurationSource<'_>) -> Self
pub fn new(source: &ConfigurationSource<'_>) -> Self
Allocates and returns a new configuration based on the given site specific configuration.
Sourcepub fn parse_with_timeout<'a>(
&self,
wiki_text: &'a str,
max_duration: Duration,
) -> Result<Output<'a>, ParseError<'a>>
pub fn parse_with_timeout<'a>( &self, wiki_text: &'a str, max_duration: Duration, ) -> Result<Output<'a>, ParseError<'a>>
Parses wiki text into structured data with a user defined timeout.
Sourcepub fn parse<'a>(
&self,
wiki_text: &'a str,
) -> Result<Output<'a>, ParseError<'a>>
pub fn parse<'a>( &self, wiki_text: &'a str, ) -> Result<Output<'a>, ParseError<'a>>
Parses wiki text into structured data with a default timeout of 5 seconds.
Sourcepub fn parse_without_timeout<'a>(
&self,
wiki_text: &'a str,
) -> Result<Output<'a>, ParseError<'a>>
pub fn parse_without_timeout<'a>( &self, wiki_text: &'a str, ) -> Result<Output<'a>, ParseError<'a>>
Parses wiki text into structured data with no time out. This function may run for extremely long lengths of time on certain articles
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Configuration
impl RefUnwindSafe for Configuration
impl Send for Configuration
impl Sync for Configuration
impl Unpin for Configuration
impl UnwindSafe for Configuration
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