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,

source

pub fn from_buf_reader( buf_reader: BufReader<impl Read + 'a>, config: Config ) -> Result<Self, ParseError>

Creates a parser reading from a BufReader.

source

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.

source

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.

source

pub fn new(reader: LineReader<'a>, config: Config) -> Result<Self, ParseError>

Creates a parser reading from a LineReader.

source

pub fn header(&self) -> Option<Header>

Returns the DIMACS CNF header if it was present.

source

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.