Struct MultilinearParser

Source
pub struct MultilinearParser(/* private fields */);
Expand description

A parser for multilinear system definitions, supporting incremental parsing across multiple files or input streams.

Implementations§

Source§

impl MultilinearParser

Source

pub fn add_new_channel( &mut self, channel_name: &str, default_name: &str, ) -> Result<Channel, ChannelAddingError>

Adds a new channel and sets a default value.

Fails if channel already exists or if the names aren’t valid.

Source

pub fn parse<R: Read>( &mut self, reader: R, parent_namespace: &[Box<str>], ) -> Result<(), Error>

Parses additional multilinear data from the given reader.

§Arguments
  • reader - The input source to parse from
  • namespace - Initial header context/path for events (e.g., vec!["Main Story".into()])
§Example
use std::fs::File;
use multilinear_parser::MultilinearParser;

let mut parser = MultilinearParser::default();
parser.parse(File::open("chapter1.mld").unwrap(), Vec::new()).unwrap();
parser.parse(File::open("chapter2.mld").unwrap(), Vec::new()).unwrap();
Source

pub fn into_info(self) -> NamedMultilinearInfo

Consumes the parser and returns the fully parsed data.

After calling this, the parser can no longer be used.

Trait Implementations§

Source§

impl Default for MultilinearParser

Source§

fn default() -> MultilinearParser

Returns the “default value” for a type. Read more

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.