[][src]Struct streamson_lib::path::Emitter

pub struct Emitter { /* fields omitted */ }

Reads parts of UTF-8 json input and emits paths e.g. reading of

{
    "People": [
        {"Height": 180, "Age": 33},
        {"Height": 175, "Age": 24}
    ]
}

should emit (index and path)

Start( 0, "")
Start( 1, "{\"People\"}")
Start( 3, "{\"People\"}[0]")
Start( 4, "{\"People\"}[0]{\"Height\"}")
End(   5, "{\"People\"}[0]{\"Height\"}")
Start( 6, "{\"People\"}[0]{\"Age\"}")
End(   7, "{\"People\"}[0]{\"Age\"}")
End(   8, "{\"People\"}[0]")
Start( 9, "{\"People\"}[1]")
Start(10, "{\"People\"}[1]{\"Height\"}")
End(  11, "{\"People\"}[1]{\"Height\"}")
Start(12, "{\"People\"}[1]{\"Age\"}")
End(  13, "{\"People\"}[1]{\"Age\"}")
End(  14, "{\"People\"}[1]")
End(  15, "{\"People\"}")
End(  16, "")
Finished

Implementations

impl Emitter[src]

pub fn new() -> Self[src]

Creates a new path emitter

pub fn feed(&mut self, input: &[u8])[src]

Feed emitter with data

pub fn read(&mut self) -> Result<Output, General>[src]

Reads data from emitter and emits Output struct

Errors

If invalid JSON is passed and error may be emitted. Note that validity of input JSON is not checked.

Trait Implementations

impl Debug for Emitter[src]

impl Default for Emitter[src]

Auto Trait Implementations

impl RefUnwindSafe for Emitter

impl Send for Emitter

impl Sync for Emitter

impl Unpin for Emitter

impl UnwindSafe for Emitter

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.