[][src]Struct gameshell::PartialParse

pub struct PartialParse { /* fields omitted */ }

A partial parse is a parse where we send single bytes into the parser and get back a complete parsing state. This is useful when reading TCP streams or other streams that may yield at any point in time.

This structure does not in any way do any interpreting or evaluate, it's just used for stream parsing. This structure is quite low-level. See the tests in this file to see how it operates, based on that, you need to add surrounding facilities where you use this struct to handle the outputs it gives you.

Methods

impl PartialParse[src]

pub fn parse_increment(&mut self, input: u8) -> PartialParseOp[src]

Parses. 1 byte at a time

This function assumes that a linear stream of bytes is fed into it.

It will return PartialParseOp::Discard when there has been an error. In such cases, all previous bytes ought to be discarded and not interpreted.

When it returns PartialParseOp::Ready, it means that the previous bytes (except for those that were marked PartialParseOp::Discard) can be sent into interpret_single safely.

When it returns PartialParseOp::Unready, it means that the parser simply noticed the character and advanced its internal state.

Trait Implementations

impl PartialEq<PartialParse> for PartialParse[src]

impl Debug for PartialParse[src]

impl Default for PartialParse[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> From<T> for 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.

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

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

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