frame-conv 0.2.0

Conversation patterns — request-response, subscription, pub/sub, and workflow over liminal
Documentation
//! The caller-owned resume-state boundary, in frame vocabulary.
//!
//! The F-0c characterization proved cursor/resume-state persistence is
//! CALLER-owned while the substrate owns barrier ordering (commit-seal →
//! persist → release) — F-0c-FINDINGS §R4. This trait is that boundary at
//! frame-conv's seam; the crate adapts it to the substrate internally so no
//! substrate type appears in the public surface.

use crate::error::StoreError;

/// Durable storage for a participant's canonical resume-state bytes.
///
/// Implementations must durably replace the previously committed bytes
/// before returning `Ok(())` — the substrate's write-ahead barrier releases
/// operation authority only after this boundary succeeds.
pub trait ResumeStore: Send {
    /// Durably replaces the stored canonical resume-state bytes.
    ///
    /// # Errors
    ///
    /// Returns [`StoreError`] when the bytes were not durably committed; the
    /// failure propagates typed and no operation authority is released.
    fn persist(&mut self, canonical_state: &[u8]) -> Result<(), StoreError>;
}

impl<T: ResumeStore + ?Sized> ResumeStore for Box<T> {
    fn persist(&mut self, canonical_state: &[u8]) -> Result<(), StoreError> {
        (**self).persist(canonical_state)
    }
}