pub struct ContinuousDecoder<const MAX_SYMBOL_SIZE: usize, const MAX_WINDOW_SYMBOLS: usize, const MAX_EQUATIONS: usize> { /* private fields */ }Expand description
Stateful, bounded RFC 8681 decoder and ordered CopperList assembler.
Recovered records are delivered to the caller immediately and are never retained in an ever-growing history. Exact gap reporting assumes the sender serializes CopperLists in increasing identifier order, as generated Copper runtimes do. Assembly buffers grow on demand up to receiver limits and are recycled after delivery or expiry. Once buffer sizes and concurrency have warmed up, record assembly and borrowed delivery need no heap allocations.
Implementations§
Source§impl<const MAX_SYMBOL_SIZE: usize, const MAX_WINDOW_SYMBOLS: usize, const MAX_EQUATIONS: usize> ContinuousDecoder<MAX_SYMBOL_SIZE, MAX_WINDOW_SYMBOLS, MAX_EQUATIONS>
impl<const MAX_SYMBOL_SIZE: usize, const MAX_WINDOW_SYMBOLS: usize, const MAX_EQUATIONS: usize> ContinuousDecoder<MAX_SYMBOL_SIZE, MAX_WINDOW_SYMBOLS, MAX_EQUATIONS>
pub fn new( identity: StreamIdentity, lane: Lane, config: RlcConfig, equation_capacity: usize, first_object_id: u64, limits: ReceiverLimits, ) -> Result<Self>
Sourcepub fn enable_feedback(&mut self)
pub fn enable_feedback(&mut self)
Enable bounded finalized-loss accounting on the receiver worker.
pub fn source_outcomes(&self) -> SourceOutcomes
pub const fn next_object_id(&self) -> u64
pub const fn stats(&self) -> ContinuousRecoveryStats
pub fn occupancy(&self) -> ReceiverOccupancy
Sourcepub fn drain_events<E>(
&mut self,
emit: impl FnMut(ContinuousReceiveEvent<'_>) -> Result<(), E>,
) -> Result<(), ReceiveError<E>>
pub fn drain_events<E>( &mut self, emit: impl FnMut(ContinuousReceiveEvent<'_>) -> Result<(), E>, ) -> Result<(), ReceiveError<E>>
Retries delivery of ordered records or gaps already ready in receiver state.
This is useful after a consumer error and when shutting down a transport after its final datagram. A consumer failure leaves the current event pending so a later call can retry it.
Sourcepub fn finish_through<E>(
&mut self,
last_object_id: u64,
emit: impl FnMut(ContinuousReceiveEvent<'_>) -> Result<(), E>,
) -> Result<(), ReceiveError<E>>
pub fn finish_through<E>( &mut self, last_object_id: u64, emit: impl FnMut(ContinuousReceiveEvent<'_>) -> Result<(), E>, ) -> Result<(), ReceiveError<E>>
Finalizes ordered delivery through an inclusive CopperList identifier.
Any unresolved record or wholly absent identifier through last_object_id
is emitted as a terminal gap. Calling this method is an explicit promise
that no more useful repair symbols for that range will arrive.
Sourcepub fn receive_datagram<E>(
&mut self,
datagram: &[u8],
emit: impl FnMut(ContinuousReceiveEvent<'_>) -> Result<(), E>,
) -> Result<(), ReceiveError<E>>
pub fn receive_datagram<E>( &mut self, datagram: &[u8], emit: impl FnMut(ContinuousReceiveEvent<'_>) -> Result<(), E>, ) -> Result<(), ReceiveError<E>>
Validates and submits one carrier-verified datagram. Malformed or foreign packets are counted
and ignored before they can contaminate the FEC decoder. Recovered records
and definitive gaps are emitted in CopperList-id order.
Callers must uphold the packet integrity contract of crate::CuStreamRx.
Auto Trait Implementations§
impl<const MAX_SYMBOL_SIZE: usize, const MAX_WINDOW_SYMBOLS: usize, const MAX_EQUATIONS: usize> Freeze for ContinuousDecoder<MAX_SYMBOL_SIZE, MAX_WINDOW_SYMBOLS, MAX_EQUATIONS>
impl<const MAX_SYMBOL_SIZE: usize, const MAX_WINDOW_SYMBOLS: usize, const MAX_EQUATIONS: usize> RefUnwindSafe for ContinuousDecoder<MAX_SYMBOL_SIZE, MAX_WINDOW_SYMBOLS, MAX_EQUATIONS>where
Box<Decoder<MAX_SYMBOL_SIZE, MAX_WINDOW_SYMBOLS, MAX_EQUATIONS>>: RefUnwindSafe,
Option<SourceObserver<MAX_WINDOW_SYMBOLS>>: RefUnwindSafe,
impl<const MAX_SYMBOL_SIZE: usize, const MAX_WINDOW_SYMBOLS: usize, const MAX_EQUATIONS: usize> Send for ContinuousDecoder<MAX_SYMBOL_SIZE, MAX_WINDOW_SYMBOLS, MAX_EQUATIONS>
impl<const MAX_SYMBOL_SIZE: usize, const MAX_WINDOW_SYMBOLS: usize, const MAX_EQUATIONS: usize> Sync for ContinuousDecoder<MAX_SYMBOL_SIZE, MAX_WINDOW_SYMBOLS, MAX_EQUATIONS>
impl<const MAX_SYMBOL_SIZE: usize, const MAX_WINDOW_SYMBOLS: usize, const MAX_EQUATIONS: usize> Unpin for ContinuousDecoder<MAX_SYMBOL_SIZE, MAX_WINDOW_SYMBOLS, MAX_EQUATIONS>
impl<const MAX_SYMBOL_SIZE: usize, const MAX_WINDOW_SYMBOLS: usize, const MAX_EQUATIONS: usize> UnsafeUnpin for ContinuousDecoder<MAX_SYMBOL_SIZE, MAX_WINDOW_SYMBOLS, MAX_EQUATIONS>where
Box<Decoder<MAX_SYMBOL_SIZE, MAX_WINDOW_SYMBOLS, MAX_EQUATIONS>>: UnsafeUnpin,
Option<SourceObserver<MAX_WINDOW_SYMBOLS>>: UnsafeUnpin,
impl<const MAX_SYMBOL_SIZE: usize, const MAX_WINDOW_SYMBOLS: usize, const MAX_EQUATIONS: usize> UnwindSafe for ContinuousDecoder<MAX_SYMBOL_SIZE, MAX_WINDOW_SYMBOLS, MAX_EQUATIONS>where
Box<Decoder<MAX_SYMBOL_SIZE, MAX_WINDOW_SYMBOLS, MAX_EQUATIONS>>: UnwindSafe,
Option<SourceObserver<MAX_WINDOW_SYMBOLS>>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more