pub struct Engine<P: TextProfile, const SLOTS: usize = 4, const PAGES: usize = 24> { /* private fields */ }Expand description
The deterministic text engine.
SLOTS/PAGES size the shared reassembly pool (a page is 80 bytes; a
full 160-byte fragment consumes two pages).
Implementations§
Source§impl<P: TextProfile, const SLOTS: usize, const PAGES: usize> Engine<P, SLOTS, PAGES>
impl<P: TextProfile, const SLOTS: usize, const PAGES: usize> Engine<P, SLOTS, PAGES>
Sourcepub fn new(
profile: P,
local_key: PublicKey,
config: EngineConfig,
jitter_seed: u64,
) -> Self
pub fn new( profile: P, local_key: PublicKey, config: EngineConfig, jitter_seed: u64, ) -> Self
jitter_seed drives group-repair desynchronization only; it is
scheduling randomness, not security material.
Sourcepub fn poll_output(&mut self) -> Option<Output>
pub fn poll_output(&mut self) -> Option<Output>
Drain the next output. The render arena resets when this returns
None, invalidating previously returned BodyRefs.
Sourcepub fn set_local_handle(&mut self, handle: &str)
pub fn set_local_handle(&mut self, handle: &str)
Set the display name carried on our own group messages.
Truncated to the wire limit on a character boundary. An empty name clears it, and group messages then go out unnamed — recipients see only the claimed hint.
Sourcepub fn lost_outputs(&self) -> u32
pub fn lost_outputs(&self) -> u32
Outputs dropped because the queue overflowed (platform drained too slowly). Nonzero values warrant a resync from persistent storage.
Sourcepub fn restore(&mut self, checkpoints: &[StreamCheckpoint], _now_ms: u64)
pub fn restore(&mut self, checkpoints: &[StreamCheckpoint], _now_ms: u64)
Seed outbound stream continuity from persisted checkpoints. Restored conversations resume their sequence at first use.
Continuity is tracked in memory for 8 active plus 24 cold conversations. Pass checkpoints oldest-first: when more are supplied than the cold stash holds, the earliest entries are the ones displaced. A conversation without retained continuity (never restored, or displaced past the bound) starts a fresh epoch and announces a lazy Sequence Reset — safe by design, at the cost of receivers re-baselining that stream.
Sourcepub fn compose(
&mut self,
conversation: ConversationKey,
client_token: u32,
intent: ComposeIntent<'_>,
now_ms: u64,
) -> Result<MessageHandle, ComposeError>
pub fn compose( &mut self, conversation: ConversationKey, client_token: u32, intent: ComposeIntent<'_>, now_ms: u64, ) -> Result<MessageHandle, ComposeError>
Compose and queue an outbound message. Returns the stable handle of the affected transcript record.
Sourcepub fn receive(
&mut self,
envelope: &Envelope,
sender_full_key: Option<PublicKey>,
payload: &[u8],
now_ms: u64,
) -> Result<(), ReceiveError>
pub fn receive( &mut self, envelope: &Envelope, sender_full_key: Option<PublicKey>, payload: &[u8], now_ms: u64, ) -> Result<(), ReceiveError>
Feed one MAC-validated received text payload (without the payload-type byte) through the engine.
sender_full_key resolves a claimed multicast member to a full public
key when the platform knows it; it is required for that sender’s
streams to be repairable.
Sourcepub fn transmit_update(
&mut self,
transmission_id: u32,
state: DeliveryState,
now_ms: u64,
)
pub fn transmit_update( &mut self, transmission_id: u32, state: DeliveryState, now_ms: u64, )
Report transport progress for a previously emitted transmission.
Sourcepub fn archive_result(
&mut self,
request_id: u32,
result: ArchiveResult<'_>,
now_ms: u64,
)
pub fn archive_result( &mut self, request_id: u32, result: ArchiveResult<'_>, now_ms: u64, )
Answer a previously emitted LookupOutbound effect.