Trait StreamSealer
pub trait StreamSealer: Send + 'static {
// Required methods
fn seal_item<'life0, 'async_trait>(
&'life0 mut self,
item: Bytes,
) -> Pin<Box<dyn Future<Output = Result<SealedItem, CratestackError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn checkpoint_now<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, CratestackError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn finish<'async_trait>(
self: Box<Self>,
end: StreamEnd,
) -> Pin<Box<dyn Future<Output = Result<Bytes, CratestackError>> + Send + 'async_trait>>
where Self: 'async_trait;
}Expand description
Seals one outgoing stream (§6). Created per stream by
CratestackEnvelope::stream_sealer,
which seeds the running hash with h₀ = SHA-256(external_aad).
Provisional; the shape is finalised in P1 (cratestack#1008).
Required Methods§
fn seal_item<'life0, 'async_trait>(
&'life0 mut self,
item: Bytes,
) -> Pin<Box<dyn Future<Output = Result<SealedItem, CratestackError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn seal_item<'life0, 'async_trait>(
&'life0 mut self,
item: Bytes,
) -> Pin<Box<dyn Future<Output = Result<SealedItem, CratestackError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Feed one item’s encoded bytes and return what to write.
fn checkpoint_now<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, CratestackError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn checkpoint_now<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, CratestackError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Emit a checkpoint now if any item is not yet covered by one. This is
the hook for the time-based cadence (every 2 s; ADR 0006 Q3), which
can fall due between items. None when there is nothing to cover.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".