[−][src]Struct weave::Parser
A Parser is used to process a weave file, extracting either everything, or only a specific delta.
Methods
impl<S: Sink> Parser<S, BufReader<Box<dyn Read>>>
[src]
pub fn new(
naming: &dyn NamingConvention,
sink: S,
delta: usize
) -> Result<Parser<S, BufReader<Box<dyn Read>>>>
[src]
naming: &dyn NamingConvention,
sink: S,
delta: usize
) -> Result<Parser<S, BufReader<Box<dyn Read>>>>
Construct a parser, based on the main file of the naming convention.
impl<S: Sink, B: BufRead> Parser<S, B>
[src]
pub fn new_raw(
source: Lines<B>,
sink: Rc<RefCell<S>>,
delta: usize
) -> Result<Parser<S, B>>
[src]
source: Lines<B>,
sink: Rc<RefCell<S>>,
delta: usize
) -> Result<Parser<S, B>>
Construct a new Parser, reading from the given Reader, giving records to the given Sink,
and aiming for the specified delta
. This is not the intended constructor, normal users
should use new
. (This is public, for testing).
pub fn parse_to(&mut self, lineno: usize) -> Result<usize>
[src]
Run the parser until we either reach the given line number, or the end of the weave. Lines are numbered from 1, so calling with a lineno of zero will run the parser until the end of the input. Returns Ok(0) for the end of input, Ok(n) for stopping at line n (which should always be the same as the passed in lineno, or Err if there is an error.
pub fn get_header(&self) -> &Header
[src]
Get the header read from this weave file.
pub fn into_header(self) -> Header
[src]
Consume the parser, returning the header.
pub fn get_sink(&self) -> Rc<RefCell<S>>
[src]
Get a copy of the sink.
Auto Trait Implementations
impl<S, B> Unpin for Parser<S, B> where
B: Unpin,
B: Unpin,
impl<S, B> !Sync for Parser<S, B>
impl<S, B> !Send for Parser<S, B>
impl<S, B> !UnwindSafe for Parser<S, B>
impl<S, B> !RefUnwindSafe for Parser<S, B>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,