mongodb 0.4.0

A native MongoDB driver developed under MongoDB labs.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use apm::{CommandStarted, CommandResult};
use Client;
use error::Result;

pub trait EventRunner {
    fn run_start_hooks(&self, hook: &CommandStarted) -> Result<()>;
    fn run_completion_hooks(&self, hook: &CommandResult) -> Result<()>;
}

impl EventRunner for Client {
    fn run_start_hooks(&self, hook: &CommandStarted) -> Result<()> {
        self.listener.run_start_hooks(self.clone(), hook)
    }

    fn run_completion_hooks(&self, hook: &CommandResult) -> Result<()> {
        self.listener.run_completion_hooks(self.clone(), hook)
    }
}