Struct exar::DatabaseConfig [] [src]

pub struct DatabaseConfig {
    pub logs_path: String,
    pub index_granularity: u64,
    pub routing_strategy: RoutingStrategy,
    pub scanners: ScannersConfig,
    pub collections: BTreeMap<StringPartialCollectionConfig>,
}

Exar DB's configuration.

Examples

extern crate exar;

use exar::*;
use std::collections::BTreeMap;

let config = DatabaseConfig {
    logs_path: "/path/to/logs".to_owned(),
    index_granularity: 100000,
    routing_strategy: RoutingStrategy::default(),
    scanners: ScannersConfig {
        nr_of_scanners: 2,
        sleep_time_in_ms: 10
    },
    collections: BTreeMap::new()
};

Fields

logs_path: String

Path to the logs directory.

index_granularity: u64

Granularity of the log lines index (used by IndexedLineReader).

routing_strategy: RoutingStrategy

Subscriptions' routing strategy.

scanners: ScannersConfig

Log scanners' configuration.

collections: BTreeMap<StringPartialCollectionConfig>

Holds collection-specific configuration overrides.

Methods

impl DatabaseConfig
[src]

fn collection_config(&self, collection_name: &str) -> CollectionConfig

Returns the configuration for a given collection by applying overrides to the base DatabaseConfig.

fn scanners_sleep_duration(&self) -> Duration

Returns the scanners sleep as an instance of Duration.

Trait Implementations

impl Decodable for DatabaseConfig
[src]

fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<DatabaseConfig, __D::Error>

impl Encodable for DatabaseConfig
[src]

fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>

impl Eq for DatabaseConfig
[src]

impl PartialEq for DatabaseConfig
[src]

fn eq(&self, __arg_0: &DatabaseConfig) -> bool

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

fn ne(&self, __arg_0: &DatabaseConfig) -> bool

This method tests for !=.

impl Debug for DatabaseConfig
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Clone for DatabaseConfig
[src]

fn clone(&self) -> DatabaseConfig

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Default for DatabaseConfig
[src]

fn default() -> DatabaseConfig

Returns the "default value" for a type. Read more