Struct flussab_cnf::cnf::Parser [−][src]
Parser for the DIMACS CNF file format.
Implementations
impl<'a, L> Parser<'a, L> where
L: Dimacs,
[src]
L: Dimacs,
pub fn from_buf_reader(
buf_reader: BufReader<impl Read + 'a>,
strict: bool
) -> Result<Self, ParseError>
[src]
buf_reader: BufReader<impl Read + 'a>,
strict: bool
) -> Result<Self, ParseError>
Creates a parser reading from a BufReader
.
When strict
is false, the variable and clause count of the DIMACS CNF header are ignored
during parsing.
pub fn from_read(read: impl Read + 'a, strict: bool) -> Result<Self, ParseError>
[src]
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.
When strict
is false, the variable and clause count of the DIMACS CNF header are ignored
during parsing.
pub fn from_boxed_dyn_read(
read: Box<dyn Read + 'a>,
strict: bool
) -> Result<Self, ParseError>
[src]
read: Box<dyn Read + 'a>,
strict: bool
) -> 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.
When strict
is false, the variable and clause count of the DIMACS CNF header are ignored
during parsing.
pub fn new(reader: LineReader<'a>, strict: bool) -> Result<Self, ParseError>
[src]
Creates a parser reading from a LineReader
.
pub fn header(&self) -> Option<Header>
[src]
Returns the DIMACS CNF header if it was present.
pub fn next_clause(&mut self) -> Result<Option<&[L]>, ParseError>
[src]
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,
L: Unpin,
impl<'a, L> !UnwindSafe for Parser<'a, L>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,