pub struct Transmitter { /* private fields */ }Expand description
One peer’s preallocated local ledger, correlated probes, and bounded repair.
The actor and simulator share this policy. Neither timer expiry nor an unsolicited partial receipt schedules a retransmission. Only a valid response to a live probe can identify an outstanding range for repair. Payload ownership, authenticated binding, role checks, journal generations, and quorum stay outside.
Implementations§
Source§impl Transmitter
impl Transmitter
Sourcepub fn new(
scope: Scope,
limits: PipelineLimits,
first: RequestId,
timing: ProbeTiming,
now: Duration,
) -> Result<Self, TransmitError>
pub fn new( scope: Scope, limits: PipelineLimits, first: RequestId, timing: ProbeTiming, now: Duration, ) -> Result<Self, TransmitError>
Reserve this sender’s local metadata window and start fresh probe correlation. Remote receipt reports cannot increase this allocation.
Sourcepub fn enable_broadcast(&mut self)
pub fn enable_broadcast(&mut self)
Enable loss-tolerant PUB delivery. PEER reservations cover repair only. Receivers report PUB receipt unasked, so new work waits for the probe delay.
Sourcepub fn needs_catch_up(&self) -> bool
pub fn needs_catch_up(&self) -> bool
A correlated probe found missing publications beyond existing reservations. Fresh PEER sends are allowed only while the frozen target remains unsent.
Sourcepub const fn catch_up_through(&self) -> Option<OpNumber>
pub const fn catch_up_through(&self) -> Option<OpNumber>
Frozen upper bound for fresh PEER catch-up in broadcast mode.
Sourcepub fn sender(&self) -> Option<&Sender>
pub fn sender(&self) -> Option<&Sender>
Active peer ledger, or none until exact history verifies a correlated open.
Sourcepub const fn candidate(&self) -> Option<OpenRequest>
pub const fn candidate(&self) -> Option<OpenRequest>
Pending history check, for matching asynchronous callbacks before adoption.
Sourcepub const fn pending_probe(&self) -> Option<Probe>
pub const fn pending_probe(&self) -> Option<Probe>
Current immutable exchange, for adapter correlation and diagnostics.
Sourcepub fn replace_session(&mut self, now: Duration) -> Result<(), TransmitError>
pub fn replace_session(&mut self, now: Duration) -> Result<(), TransmitError>
Fence link-session correlation without granting fresh receive capacity. Retain the channel ledger, outstanding sends, and any established repair. A new probe verifies peer state; an old asynchronous history lookup cannot install its retired candidate after the session changes.
Sourcepub fn change_scope(
&mut self,
scope: Scope,
now: Duration,
) -> Result<(), TransmitError>
pub fn change_scope( &mut self, scope: Scope, now: Duration, ) -> Result<(), TransmitError>
Fence a changed normal scope while retaining all startup allocations and IDs. Reconnection alone does not call this method or reset local accounting.
Sourcepub fn next_probe(&self) -> Option<Duration>
pub fn next_probe(&self) -> Option<Duration>
When poll_probe next sends or retries on time alone. None while a
repair runs, which probes never overtake.
Sourcepub fn poll_probe(
&mut self,
available: Prefix,
transport_pending: bool,
now: Duration,
) -> Result<Option<Probe>, TransmitError>
pub fn poll_probe( &mut self, available: Prefix, transport_pending: bool, now: Duration, ) -> Result<Option<Probe>, TransmitError>
Poll small status traffic independently of durable ACK or election timers.
transport_pending includes this peer’s locally retained data transmissions.
Do not let a probe overtake that queue and mistake unsent bytes for a gap.
Poll while durability/receipt remains unresolved, including received
but not durably acknowledged bytes: a receiver can reset after volatile receipt.
Sourcepub fn record_send(&mut self, operations: &[Operation]) -> Result<(), FlowError>
pub fn record_send(&mut self, operations: &[Operation]) -> Result<(), FlowError>
Reserve a fresh suffix once after ensuring the adapter can retain its packet. Known repair takes precedence over sending more data beyond that gap.
Sourcepub fn observe(
&mut self,
report: Report,
request_id: Option<RequestId>,
now: Duration,
) -> Result<StatusOutcome, TransmitError>
pub fn observe( &mut self, report: Report, request_id: Option<RequestId>, now: Duration, ) -> Result<StatusOutcome, TransmitError>
Observe authenticated status. Unknown epochs need correlation plus history. Same-epoch unsolicited receipts may retire reservations but never request repair.
Sourcepub fn observe_with_repair_limit(
&mut self,
report: Report,
request_id: Option<RequestId>,
repair_limit: Option<OpNumber>,
now: Duration,
) -> Result<StatusOutcome, TransmitError>
pub fn observe_with_repair_limit( &mut self, report: Report, request_id: Option<RequestId>, repair_limit: Option<OpNumber>, now: Duration, ) -> Result<StatusOutcome, TransmitError>
A correlated response may stop repair before data already held on SUB. The bound grants no capacity or history authority and cannot exceed the probe.
Sourcepub fn open_verified(
&mut self,
request: OpenRequest,
base: Prefix,
received: Prefix,
now: Duration,
) -> Result<bool, TransmitError>
pub fn open_verified( &mut self, request: OpenRequest, base: Prefix, received: Prefix, now: Duration, ) -> Result<bool, TransmitError>
Adopt only the still-current candidate after exact local-history verification.
Prefix arguments must come from current-generation local history, not copied report fields. Stale callbacks return false. Old pending payloads must be fenced by their epochs; they cannot become reservations in the new channel.