[][src]Struct streamson_lib::handler::indexer::Indexer

pub struct Indexer { /* fields omitted */ }

Indexer handler responsible for storing index of the matches

Implementations

impl Indexer[src]

pub fn new() -> Self[src]

Creates a new handler which stores indexes within itself

pub fn set_use_path(self, use_path: bool) -> Self[src]

Set whether to show path

Arguments

  • use_path - should path be store with data

Example

use streamson_lib::handler;
let file = handler::Indexer::new().set_use_path(true);

pub fn pop(&mut self) -> Option<(Option<String>, Output)>[src]

Pops the oldest value in the buffer

Returns

  • None - queue is empty
  • Some((path, output)) - stored data remove from the queue and returned

Example

use streamson_lib::handler;
let mut indexer = handler::Indexer::new().set_use_path(true);
while let Some((path, output)) = indexer.pop() {
    // Do something with the data
    println!("{} ({:?})", path.unwrap(), output);
}

Trait Implementations

impl Debug for Indexer[src]

impl Default for Indexer[src]

impl Handler for Indexer[src]

Auto Trait Implementations

impl RefUnwindSafe for Indexer

impl Send for Indexer

impl Sync for Indexer

impl Unpin for Indexer

impl UnwindSafe for Indexer

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.