Skip to main content

Module rt_safety

Module rt_safety 

Source
Expand description

Real-time safety enforcement.

Provides utilities for verifying the audio callback is allocation-free. The actual allocator wrapping must happen at the binary level (main.rs), not at the library level. This module provides the API and documentation.

Constants§

RT_RULES
A list of real-time rules for documentation and enforcement.

Traits§

RtSafe
Marker trait for types that are safe to use in the audio callback. Types that implement this promise they will never allocate, block, or do I/O.

Functions§

enter_rt
Enter real-time context. Call at the start of the audio callback.
exit_rt
Exit real-time context. Call at the end of the audio callback.
is_rt
Check if we’re currently in a real-time context.
rt_guard
Run a closure in real-time context. Sets the RT flag, runs the closure, then clears the flag.