pub struct MemoryInput { /* private fields */ }Expand description
Thread-safe bounded input endpoint for a TSDuck memory plugin.
Every payload must contain complete 188-byte TS packets. close causes a
bound input callback to report EOF after draining queued data; abort
wakes blocked producers/callbacks and fails the transfer.
Implementations§
Source§impl MemoryInput
impl MemoryInput
Sourcepub fn new(
capacity_bytes: NonZeroUsize,
policy: MemoryQueuePolicy,
) -> Result<Arc<Self>>
pub fn new( capacity_bytes: NonZeroUsize, policy: MemoryQueuePolicy, ) -> Result<Arc<Self>>
Creates a bounded input endpoint with a capacity in complete TS packets.
Sourcepub fn push(&self, data: &[u8]) -> Result<MemoryPushOutcome>
pub fn push(&self, data: &[u8]) -> Result<MemoryPushOutcome>
Copies a packet-aligned input slice into queue-owned storage.
Sourcepub fn push_owned(&self, data: Vec<u8>) -> Result<MemoryPushOutcome>
pub fn push_owned(&self, data: Vec<u8>) -> Result<MemoryPushOutcome>
Moves packet-aligned input storage into the queue.
A complete owned queue head can move directly into the next native input callback response, avoiding a Rust-side reassembly allocation.
Shares immutable packet-aligned storage with the queue.
Sourcepub fn queued_bytes(&self) -> usize
pub fn queued_bytes(&self) -> usize
Returns queued input bytes.
Sourcepub fn dropped_bytes(&self) -> usize
pub fn dropped_bytes(&self) -> usize
Returns bytes rejected by the drop policy.
Sourcepub fn take_callback_error(&self) -> Option<CallbackError>
pub fn take_callback_error(&self) -> Option<CallbackError>
Takes the latest private callback error.
Auto Trait Implementations§
impl Freeze for MemoryInput
impl RefUnwindSafe for MemoryInput
impl Send for MemoryInput
impl Sync for MemoryInput
impl Unpin for MemoryInput
impl UnsafeUnpin for MemoryInput
impl UnwindSafe for MemoryInput
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
Mutably borrows from an owned value. Read more