pub struct PendingAck<const FRAME: usize = MAX_RESEND_FRAME_LEN> {
pub ack_trailer: [u8; 8],
pub peer: PublicKey,
pub resend: ResendRecord<FRAME>,
pub sent_ms: u64,
pub ack_deadline_ms: u64,
pub retries: u8,
pub state: AckState,
pub completion: CompletionSignal,
pub confirm_key: Option<DupCacheKey>,
}Expand description
Complete tracking state for one in-flight tracked transmission.
The coordinator’s IdentitySlot maintains a LinearMap of
PendingAck records keyed by SendReceipt, one per active tracked send — every
ACK-requested send, plus every non-ACK unicast or blind unicast that travels through
repeaters and therefore retries until a repeat is heard (CompletionSignal). The
record holds everything needed to detect completion, detect timeout, and retransmit:
ack_trailer— the 8-byteack_mic || ack_tagvalue that will appear as the destination’s MAC ACK trailer. Theack_michalf correlates the ack to this request; the keyedack_taghalf can only be produced by a node that received and successfully decrypted the original frame, so a matching trailer is cryptographic proof of delivery.peer— the destination’s full public key, used to look up the correct pending entry when matching an inbound MAC ACK against the pending table.resend— a verbatim copy of the sealed frame for retransmission. SeeResendRecord.sent_ms— the monotonic millisecond timestamp at which the frame was first transmitted; useful for latency measurement.ack_deadline_ms— absolute deadline for the final ACK. Expiry means failure and the entry is removed.retries— the number of retransmissions already attempted; capped atMAX_FORWARD_RETRIES.state— current position in theAckStatelifecycle (forwarding confirmation wait or final-ACK wait).
Use PendingAck::direct for sends to nodes in direct radio range,
PendingAck::forwarded when routing through a repeater, or
PendingAck::repeat_only for a non-ACK send that completes on an
overheard repeat.
Fields§
§ack_trailer: [u8; 8]Expected 8-byte MAC ack trailer (ack_mic || ack_tag) used for inbound
matching. Never matched for CompletionSignal::RepeatOnly entries.
peer: PublicKeyFinal destination peer.
resend: ResendRecord<FRAME>Retransmission data.
sent_ms: u64Initial send timestamp in milliseconds.
ack_deadline_ms: u64Absolute deadline for the final ACK — or, for a
CompletionSignal::RepeatOnly entry, the terminal deadline after
which the entry is silently discarded.
retries: u8Number of retries already attempted.
state: AckStateCurrent state in the ACK lifecycle.
completion: CompletionSignalWhich observation completes this send.
confirm_key: Option<DupCacheKey>Routing identity of the transmitted frame, recorded at transmit time so an overheard repeat can be matched against this entry even after the post-transmit listen window has lapsed.
Implementations§
Source§impl<const FRAME: usize> PendingAck<FRAME>
impl<const FRAME: usize> PendingAck<FRAME>
Sourcepub fn direct(
ack_trailer: [u8; 8],
peer: PublicKey,
resend: ResendRecord<FRAME>,
) -> Self
pub fn direct( ack_trailer: [u8; 8], peer: PublicKey, resend: ResendRecord<FRAME>, ) -> Self
Create pending-ACK state for a direct send.
Sourcepub fn forwarded(
ack_trailer: [u8; 8],
peer: PublicKey,
resend: ResendRecord<FRAME>,
) -> Self
pub fn forwarded( ack_trailer: [u8; 8], peer: PublicKey, resend: ResendRecord<FRAME>, ) -> Self
Create pending-ACK state for a forwarded send.
Sourcepub fn repeat_only(peer: PublicKey, resend: ResendRecord<FRAME>) -> Self
pub fn repeat_only(peer: PublicKey, resend: ResendRecord<FRAME>) -> Self
Create tracking state for a non-ACK send that completes when a repeat of the frame is overheard.
Sourcepub fn expects_ack(&self) -> bool
pub fn expects_ack(&self) -> bool
Whether a transport ACK is expected for this entry.
Trait Implementations§
Source§impl<const FRAME: usize> Clone for PendingAck<FRAME>
impl<const FRAME: usize> Clone for PendingAck<FRAME>
Source§fn clone(&self) -> PendingAck<FRAME>
fn clone(&self) -> PendingAck<FRAME>
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<const FRAME: usize> Debug for PendingAck<FRAME>
impl<const FRAME: usize> Debug for PendingAck<FRAME>
Source§impl<const FRAME: usize> PartialEq for PendingAck<FRAME>
impl<const FRAME: usize> PartialEq for PendingAck<FRAME>
impl<const FRAME: usize> Eq for PendingAck<FRAME>
impl<const FRAME: usize> StructuralPartialEq for PendingAck<FRAME>
Auto Trait Implementations§
impl<const FRAME: usize> Freeze for PendingAck<FRAME>
impl<const FRAME: usize> RefUnwindSafe for PendingAck<FRAME>
impl<const FRAME: usize> Send for PendingAck<FRAME>
impl<const FRAME: usize> Sync for PendingAck<FRAME>
impl<const FRAME: usize> Unpin for PendingAck<FRAME>
impl<const FRAME: usize> UnwindSafe for PendingAck<FRAME>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)