cnc-rs 0.1.4

A Rust-based project for PostgreSQL replication and email notifications with a configurable CLI.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use anyhow::Result;

/// Trait defining basic operations for interacting with a database.
///
/// Types implementing this trait can be used with the `DBOperations` struct for managing database logic.
pub trait DatabaseOperations {
    /// Establishes a connection to the database.
    fn connect(&mut self) -> Result<(), anyhow::Error>;

    /// Closes the database connection.
    fn close(&mut self) -> Result<(), anyhow::Error>;

    /// Replicates the database state.
    fn replicate(&mut self) -> Result<(), anyhow::Error>;
}