pub struct M3tParser<'a> {
str: &'a str,
line: usize,
llm_mark: Option<&'a str>,
use_original_text: bool,
}Expand description
A parser for the M3T format.
Fields§
§str: &'a str§line: usize§llm_mark: Option<&'a str>§use_original_text: boolImplementations§
Source§impl<'a> M3tParser<'a>
impl<'a> M3tParser<'a>
Sourcepub fn new(
str: &'a str,
llm_mark: Option<&'a str>,
use_original_text: bool,
) -> Self
pub fn new( str: &'a str, llm_mark: Option<&'a str>, use_original_text: bool, ) -> Self
Creates a new M3tParser with the given string.
fn next_line(&mut self) -> Option<&'a str>
pub fn parse_as_vec(&mut self) -> Result<Vec<(String, String)>>
Sourcepub fn parse(&mut self) -> Result<Vec<Message>>
pub fn parse(&mut self) -> Result<Vec<Message>>
Parses the M3T format and returns a vector of messages.
pub fn parse_as_extend(&mut self) -> Result<Vec<ExtendedMessage>>
Auto Trait Implementations§
impl<'a> Freeze for M3tParser<'a>
impl<'a> RefUnwindSafe for M3tParser<'a>
impl<'a> Send for M3tParser<'a>
impl<'a> Sync for M3tParser<'a>
impl<'a> Unpin for M3tParser<'a>
impl<'a> UnwindSafe for M3tParser<'a>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more