rustduck_core/memory/mod.rs
1//! Typed, bounded memory endpoints for TSDuck `memory` plugins.
2//!
3//! Endpoints are `Send + Sync` because they contain only synchronized Rust
4//! queue state. They are not raw native handles; `TSProcessor` and
5//! `InputSwitcher` perform private native registration.
6
7mod callback;
8mod endpoint;
9mod queue;
10mod registry;
11
12pub(crate) use callback::install_dispatcher;
13pub(crate) use endpoint::{MemoryInputBinding, MemoryOutputBinding};
14
15pub use endpoint::{CallbackError, MemoryInput, MemoryOutput};
16
17/// Queue behavior when there is no capacity for another complete payload.
18#[derive(Debug, Clone, Copy, PartialEq, Eq)]
19#[non_exhaustive]
20pub enum MemoryQueuePolicy {
21 /// Reject the incoming payload and record its byte count as dropped.
22 Drop,
23 /// Block the producer until capacity, close, or abort changes the state.
24 Backpressure,
25}
26
27/// Outcome of an accepted or dropped input push.
28#[derive(Debug, Clone, Copy, PartialEq, Eq)]
29#[non_exhaustive]
30pub enum MemoryPushOutcome {
31 /// The complete packet-aligned payload entered the queue.
32 Accepted,
33 /// The configured drop policy rejected the complete payload.
34 Dropped,
35}