[][src]Macro streams_rs::smatch

macro_rules! smatch {
    (@p $body: expr;$stream: expr,$cnt: expr;  -> $($pat: tt)*) => { ... };
    (@p $body: expr; $($assign: ident),*; $stream: expr,$cnt: expr; _ => $($rest:tt)*) => { ... };
    (@p $body: expr; $($assign: ident),*; $stream: expr,$cnt: expr; $name : ident => $($rest:tt)*) => { ... };
    (@p $body:expr;$($assign: ident),*;$stream: expr,$cnt: expr; $p: pat => $($rest:tt)*) => { ... };
    (@p $body: expr; $($assign: ident),*; $stream: expr,$cnt: expr; $name : ident = $p: expr => $($rest:tt)*) => { ... };
    (@p $body: expr; $($assign: ident),*;$stream: expr,$cnt: expr;) => { ... };
    (match ($s: expr) {
        $(
            [ $($p: tt)* ] => $body: expr
        ),*
    }) => { ... };
}

Macro for matching on streams.

This macro will not catch any error for you so your getter should return StreamResult<Result> if you might have any errors. If value not matched then StreamResult::Err(StreamError::EmptyStream) is returned.