Skip to main content

Crate rustduck

Crate rustduck 

Source
Expand description

Ergonomic RustDuck entry point.

The safe TSDuck API is re-exported from rustduck_core. Optional pure Rust transport-stream utilities are available only through the matching ext-* Cargo features, under the ext namespace.

§Quick start

Analyze one or more 188-byte transport-stream packets:

use rustduck::{DuckContext, Report, TS_PACKET_SIZE, TSAnalyzer};

fn main() -> rustduck::Result<()> {
    let duck = DuckContext::new(Report::null()?)?;
    let mut analyzer = TSAnalyzer::new(duck)?;
    analyzer.feed(&[0x47; TS_PACKET_SIZE])?;

    let snapshot = analyzer.snapshot()?;
    println!("{} packets", snapshot.summary.packet_count);
    Ok(())
}

Modules§

ext
Explicitly opt-in transport-stream extensions.

Structs§

AbortToken
A cloneable, thread-safe request-only processor stop token.
AsyncReportConfig
Configuration for an asynchronous TSDuck report.
DuckContext
A TSDuck execution context borrowing a Report.
InputSwitcher
A !Send + !Sync native input-switcher owner.
InputSwitcherConfig
Typed configuration for one InputSwitcher start.
MemoryInput
Thread-safe bounded input endpoint for a TSDuck memory plugin.
MemoryOutput
Thread-safe bounded output endpoint for a TSDuck memory plugin.
PluginChain
An ordered processor-plugin chain.
PluginOptions
One TSDuck plugin name and its command-line arguments.
ProcessorConfig
Typed configuration for one TSProcessor start.
Report
A TSDuck report owner.
ReportForwarder
Thread-safe native-report callback forwarding.
SectionFile
In-memory TSDuck section-file container.
Standards
Standards mask used by a DuckContext.
SystemMonitor
A !Send + !Sync native system-monitor owner.
SystemMonitorConfig
Optional system-monitor configuration.
TSAnalyzer
A !Send + !Sync owner of TSDuck’s version-matched TSAnalyzer adapter.
TSAnalyzerCaDescriptor
A conditional-access descriptor observed in a service PMT.
TSAnalyzerPid
Statistics for one transport-stream PID.
TSAnalyzerReport
A complete Rust-owned analyzer snapshot.
TSAnalyzerService
Statistics for one service.
TSAnalyzerSummary
Aggregate transport-stream statistics from one analyzer snapshot.
TSProcessor
A !Send + !Sync TSDuck processor owner.

Enums§

BitRateConfidence
Confidence in a caller-supplied transport-stream bitrate hint.
CallbackError
A structured failure observed in the private TSDuck memory callback path.
CrcValidation
CRC handling mode used when loading binary sections.
Error
Errors reported by the safe Rust facade.
HostState
The lifecycle state of a native host.
MemoryPushOutcome
Outcome of an accepted or dropped input push.
MemoryQueuePolicy
Queue behavior when there is no capacity for another complete payload.
NativeExceptionKind
The native exception category captured at the rustduck-sys boundary.
ProcessorInput
Input selected for a processor.
ProcessorOutput
Output selected for a processor.
ReportForwarderError
An error contained while forwarding a native report callback.
Severity
TSDuck report severity.
SwitcherInput
One typed switcher input.
SwitcherOutput
Typed switcher output.
WaitStatus
Result of an owner-thread non-blocking termination check.

Constants§

M2TS_PACKET_SIZE
Size of an M2TS record containing a four-byte prefix and a TS packet.
RS204_PACKET_SIZE
Size of a transport-stream packet with a 16-byte Reed-Solomon trailer.
TS_PACKET_SIZE
Size of one MPEG-TS packet in bytes.

Type Aliases§

Result
Result type returned by this crate’s fallible operations.