Struct exar::Log [] [src]

pub struct Log { /* fields omitted */ }

Exar DB's log file abstraction.

It offers helper methods to manage a log file and its index. It also allows to open readers and writers for the log file.

Examples

extern crate exar;

use exar::*;

let log = Log::new("/path/to/logs", "test", 100);

let exists = log.ensure_exists().unwrap();
let writer = log.open_writer().unwrap();
let reader = log.open_reader().unwrap();
let index = log.compute_index().unwrap();
log.remove().unwrap();

Methods

impl Log
[src]

Returns a new Log pointing to the given path/name and using the given index granularity.

Ensure the underlying log file exists and creates it if it does not exist, it returns a DatabaseError if a failure occurs while creating the log file.

Returns a buffered reader for the underlying log file or a DatabaseError if a failure occurs.

Returns an indexed line reader for the underlying log file or a DatabaseError if a failure occurs.

Returns an indexed line reader for the underlying log file and restores the index using the given LinesIndex or a DatabaseError if a failure occurs.

Returns a buffered writer for the underlying log file or a DatabaseError if a failure occurs.

Removes the underlying log file and its index or a DatabaseError if a failure occurs.

Computes and returns the LinesIndex for the underlying log file or a DatabaseError if a failure occurs.

Returns a buffered reader for the log index file or a DatabaseError if a failure occurs.

Returns a buffered writer for the log index file or a DatabaseError if a failure occurs.

Restores and returns the log LinesIndex from the log index file or a DatabaseError if a failure occurs.

If the log index file does not exist it will be computed and persisted.

Persists the given LinesIndex to a log index file or returns a DatabaseError if a failure occurs.

Returns the path to the log file.

Returns the path to the log index file.

Returns the lines index granularity for the log file.

Trait Implementations

impl Clone for Log
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Log
[src]

Formats the value using the given formatter.

impl PartialEq for Log
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Log
[src]