Struct flussab_cnf::cnf::Parser[][src]

pub struct Parser<'a, L> { /* fields omitted */ }

Parser for the DIMACS CNF file format.

Implementations

impl<'a, L> Parser<'a, L> where
    L: Dimacs
[src]

pub fn from_buf_reader(
    buf_reader: BufReader<impl Read + 'a>,
    strict: bool
) -> Result<Self, ParseError>
[src]

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]

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

impl<'a, L> !UnwindSafe for Parser<'a, L>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.