Struct Configuration

Source
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

Source

pub fn new(source: &ConfigurationSource<'_>) -> Self

Allocates and returns a new configuration based on the given site specific configuration.

Source

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.

Source

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.

Source

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§

Source§

impl Default for Configuration

Source§

fn default() -> Self

Allocates and returns a configuration suitable for testing and quick and dirty prototyping. For correctly parsing an actual wiki, please get the correct site configuration for that particular wiki.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.