pub struct Parser<'a, L> { /* private fields */ }Expand description
Parser for the ASCII version of the AIGER file format.
Implementations§
Source§impl<'a, L> Parser<'a, L>where
L: Lit,
impl<'a, L> Parser<'a, L>where
L: Lit,
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.
Examples found in repository?
examples/roundtrip_aig_buffered.rs (line 15)
11fn main_err() -> Result<(), ParseError> {
12 let stdin = std::io::stdin();
13 let stdout = std::io::stdout();
14
15 let aig_reader = binary::Parser::<u32>::from_read(stdin.lock(), binary::Config::default())?;
16
17 let aig = aig_reader.parse()?;
18
19 let mut aag_writer = DeferredWriter::from_write(stdout.lock());
20 let aag_writer = ascii::Writer::<u32>::new(&mut aag_writer);
21
22 aag_writer.write_ordered_aig(&aig);
23 Ok(())
24}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.
pub fn latches(self) -> Result<ParseLatches<'a, L>, ParseError>
pub fn header(&self) -> &Header
Sourcepub fn parse(self) -> Result<OrderedAig<L>, ParseError>
pub fn parse(self) -> Result<OrderedAig<L>, ParseError>
Examples found in repository?
examples/roundtrip_aig_buffered.rs (line 17)
11fn main_err() -> Result<(), ParseError> {
12 let stdin = std::io::stdin();
13 let stdout = std::io::stdout();
14
15 let aig_reader = binary::Parser::<u32>::from_read(stdin.lock(), binary::Config::default())?;
16
17 let aig = aig_reader.parse()?;
18
19 let mut aag_writer = DeferredWriter::from_write(stdout.lock());
20 let aag_writer = ascii::Writer::<u32>::new(&mut aag_writer);
21
22 aag_writer.write_ordered_aig(&aig);
23 Ok(())
24}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> !UnwindSafe for Parser<'a, L>
impl<'a, L> Freeze for Parser<'a, L>
impl<'a, L> Unpin for Parser<'a, L>where
L: Unpin,
impl<'a, L> UnsafeUnpin 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