Struct exar::Scanner [] [src]

pub struct Scanner { /* fields omitted */ }

Exar DB's log file scanner.

It manages event stream subscriptions and continuously scans portions of the log file depending on the subscriptions query parameters.

Examples

extern crate exar;

use exar::*;
use std::sync::mpsc::channel;
use std::time::Duration;

let log = Log::new("/path/to/logs", "test", 100);
let event = Event::new("data", vec!["tag1", "tag2"]);

let line_reader = log.open_line_reader().unwrap();
let mut scanner = Scanner::new(line_reader, Duration::from_millis(10));

let (sender, _) = channel();
let subscription = Subscription::new(sender, Query::live());
scanner.handle_subscription(subscription).unwrap();

drop(scanner);

Methods

impl Scanner
[src]

Creates a new log scanner using the given IndexedLineReader and sleep duration.

Handles the given Subscription or returns a DatabaseError if a failure occurs.

Adds the given line to the LinesIndex or returns a DatabaseError if a failure occurs.

Adds a reference to a tail scanner that is responsible of handling live subscriptions or returns a DatabaseError if a failure occurs.

Clones the channel sender responsible to send ScannerActions to the scanner thread.

Trait Implementations

impl Clone for Scanner
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Scanner
[src]

Formats the value using the given formatter.

impl Drop for Scanner
[src]

A method called when the value goes out of scope. Read more