Skip to main content

ReconcileSink

Trait ReconcileSink 

Source
pub trait ReconcileSink: Send + Sync {
    // Required methods
    fn reconcile_pair_on<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        conn: &'life1 mut PgConnection,
        req: &'life2 ReconcilePairRequest,
    ) -> Pin<Box<dyn Future<Output = Result<ReconcileEdgeAck, ReconcileRejected>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn unreconcile_pair_on<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        conn: &'life1 mut PgConnection,
        req: &'life2 UnreconcilePairRequest,
    ) -> Pin<Box<dyn Future<Output = Result<(), ReconcileRejected>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

The reconciliation seam. A composing service implements this over accounting’s reconciliation write service; producers never depend on backbone-accounting — they reach the graph only through this port, exactly as they reach posting through crate::GlPostSink.

Required Methods§

Source

fn reconcile_pair_on<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, conn: &'life1 mut PgConnection, req: &'life2 ReconcilePairRequest, ) -> Pin<Box<dyn Future<Output = Result<ReconcileEdgeAck, ReconcileRejected>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Create a partial edge riding the caller’s transaction.

Source

fn unreconcile_pair_on<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, conn: &'life1 mut PgConnection, req: &'life2 UnreconcilePairRequest, ) -> Pin<Box<dyn Future<Output = Result<(), ReconcileRejected>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Side-effecting unlink riding the caller’s transaction: reverses generated moves, repairs groups, removes the partials between the pair.

Contract: reversals are pair-complete. The unlink removes EVERY partial between the located pair, whatever their origin and amount — it is not scoped to a subset of the pair’s history. A producer must therefore only call this for a pair whose edges it is undoing IN FULL: cancel events must carry the complete allocation set for each affected pair (an all-or-nothing document reversal), never a partial subset — a subset would restore the caller’s cached bookkeeping by less than the graph reopens, silently diverging the two. The void return reflects today’s producers (each pair carries one allocation, one edge); a future producer needing amount-scoped reversal requires a richer ack first.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§