QueuedTx

Struct QueuedTx 

Source
pub struct QueuedTx<const FRAME: usize = MAX_RESEND_FRAME_LEN> {
    pub priority: TxPriority,
    pub frame: Vec<u8, FRAME>,
    pub receipt: Option<SendReceipt>,
    pub identity_id: Option<LocalIdentityId>,
    pub sequence: u32,
    pub not_before_ms: u64,
    pub cad_attempts: u8,
    pub forward_deferrals: u8,
}
Expand description

One entry in the TxQueue waiting to be transmitted by the Mac coordinator.

Each QueuedTx holds a complete, already-sealed frame ready to hand directly to the radio driver. The coordinator does not re-seal on retransmit; the frame bytes are the authoritative on-the-wire representation.

  • priority — determines service order within the queue. See TxPriority.
  • frame — the sealed frame bytes, at most FRAME bytes. The coordinator calls radio.transmit(&entry.frame, tx_options).await when this entry reaches the head of the queue and its not_before_ms has elapsed.
  • receipt — for ACK-requested sends, the associated SendReceipt so the coordinator can update the PendingAck state after a successful transmit.
  • sequence — a monotonic counter assigned at enqueue time, used to preserve FIFO ordering among entries sharing the same priority.
  • not_before_ms — earliest acceptable transmit time in monotonic milliseconds. Entries with a future not_before_ms are skipped until the clock advances past it. Used to introduce per-node forwarding delay jitter that reduces collision probability. Zero means transmit immediately.
  • cad_attempts — number of channel-activity-detection retries already consumed on this entry; compared against MAX_CAD_ATTEMPTS to bound medium contention retries.
  • forward_deferrals — number of times a queued flood-forward has already been deferred after overhearing another copy of the same packet before it transmitted.

Fields§

§priority: TxPriority

Priority class.

§frame: Vec<u8, FRAME>

Stored frame bytes.

§receipt: Option<SendReceipt>

Optional receipt associated with the frame.

§identity_id: Option<LocalIdentityId>

Identity that owns this send; set for identity-originated sends, None for internally generated frames (MAC ACKs, forwarded frames).

§sequence: u32

Monotonic sequence number for stable ordering.

§not_before_ms: u64

Earliest transmission timestamp.

§cad_attempts: u8

Number of CAD attempts already consumed.

§forward_deferrals: u8

Number of overheard-repeat deferrals already consumed.

Implementations§

Source§

impl<const FRAME: usize> QueuedTx<FRAME>

Source

pub fn try_new( priority: TxPriority, frame: &[u8], receipt: Option<SendReceipt>, identity_id: Option<LocalIdentityId>, sequence: u32, ) -> Result<Self, CapacityError>

Create a queue entry ready to send immediately.

Source

pub fn try_new_with_state( priority: TxPriority, frame: &[u8], receipt: Option<SendReceipt>, identity_id: Option<LocalIdentityId>, sequence: u32, not_before_ms: u64, cad_attempts: u8, forward_deferrals: u8, ) -> Result<Self, CapacityError>

Create a queue entry with explicit timer and CAD state.

Trait Implementations§

Source§

impl<const FRAME: usize> Clone for QueuedTx<FRAME>

Source§

fn clone(&self) -> QueuedTx<FRAME>

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const FRAME: usize> Debug for QueuedTx<FRAME>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const FRAME: usize> PartialEq for QueuedTx<FRAME>

Source§

fn eq(&self, other: &QueuedTx<FRAME>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const FRAME: usize> Eq for QueuedTx<FRAME>

Source§

impl<const FRAME: usize> StructuralPartialEq for QueuedTx<FRAME>

Auto Trait Implementations§

§

impl<const FRAME: usize> Freeze for QueuedTx<FRAME>

§

impl<const FRAME: usize> RefUnwindSafe for QueuedTx<FRAME>

§

impl<const FRAME: usize> Send for QueuedTx<FRAME>

§

impl<const FRAME: usize> Sync for QueuedTx<FRAME>

§

impl<const FRAME: usize> Unpin for QueuedTx<FRAME>

§

impl<const FRAME: usize> UnwindSafe for QueuedTx<FRAME>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.