tigrbl_rs_ports 0.4.1

Trait and envelope boundaries for Rust atoms, handlers, engines, and callbacks.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::errors::{PortError, PortResult};
use tigrbl_rs_spec::{request::RequestEnvelope, response::ResponseEnvelope};

pub trait TransactionPort: Send + Sync {
    fn commit(&self) -> PortResult<()>;
    fn rollback(&self) -> PortResult<()>;

    fn execute(
        &self,
        table: &str,
        operation: &str,
        kind: &str,
        request: &RequestEnvelope,
    ) -> PortResult<ResponseEnvelope> {
        let _ = (table, operation, request);
        Err(PortError::not_implemented(kind))
    }
}