Struct flussab_cnf::cnf::Parser
source · pub struct Parser<'a, L> { /* private fields */ }
Expand description
Parser for the DIMACS CNF file format.
Implementations§
source§impl<'a, L> Parser<'a, L>where
L: Dimacs,
impl<'a, L> Parser<'a, L>where L: Dimacs,
sourcepub fn from_buf_reader(
buf_reader: BufReader<impl Read + 'a>,
config: Config
) -> Result<Self, ParseError>
pub fn from_buf_reader( buf_reader: BufReader<impl Read + 'a>, config: Config ) -> Result<Self, ParseError>
Creates a parser reading from a BufReader
.
sourcepub fn from_read(
read: impl Read + 'a,
config: Config
) -> Result<Self, ParseError>
pub fn from_read( read: impl Read + 'a, config: Config ) -> Result<Self, ParseError>
Creates a parser reading from a Read
instance.
If the Read
instance is a BufReader
, it is better to use
from_buf_reader
to avoid unnecessary double buffering of the
data.
sourcepub fn from_boxed_dyn_read(
read: Box<dyn Read + 'a>,
config: Config
) -> Result<Self, ParseError>
pub fn from_boxed_dyn_read( read: Box<dyn Read + 'a>, config: Config ) -> Result<Self, ParseError>
Creates a parser reading from a boxed Read
instance.
If the Read
instance is a BufReader
, it is better to use
from_buf_reader
to avoid unnecessary double buffering of the
data.
sourcepub fn new(reader: LineReader<'a>, config: Config) -> Result<Self, ParseError>
pub fn new(reader: LineReader<'a>, config: Config) -> Result<Self, ParseError>
Creates a parser reading from a LineReader
.
sourcepub fn next_clause(&mut self) -> Result<Option<&[L]>, ParseError>
pub fn next_clause(&mut self) -> Result<Option<&[L]>, ParseError>
Parses and returns the next clause.
Returns Ok(None)
if the end of file was successfully reached.
Auto Trait Implementations§
impl<'a, L> !RefUnwindSafe for Parser<'a, L>
impl<'a, L> !Send for Parser<'a, L>
impl<'a, L> !Sync for Parser<'a, L>
impl<'a, L> Unpin for Parser<'a, L>where L: Unpin,
impl<'a, L> !UnwindSafe for Parser<'a, L>
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