pub trait FrameFree: Sealed + 'static {
type Instance: Copy;
type RawFrame: Default + Copy;
const REF_DEBUG_NAME: &'static str;
// Required method
unsafe fn free(instance: Self::Instance, frame: &mut Self::RawFrame);
}Expand description
The free strategy for one captured-frame family: the SDK instance handle type plus the SDK call that releases a single frame.
This is the single axis along which the RAII Guard varies. The receiver
kinds (VideoKind, AudioKind, MetadataKind) free through
NDIlib_recv_free_*; the FrameSync strategies (FrameSyncVideoFree,
FrameSyncAudioFree) free through NDIlib_framesync_free_*. Factoring the
free call out of CaptureKind lets both families reuse one guard and one
borrowed-reference core instead of maintaining parallel copies.
This is a sealed trait — it cannot be implemented outside this crate.
§Safety
Implementors must ensure free releases a frame that was
populated by the matching SDK capture call through the same instance.
Required Associated Constants§
Sourceconst REF_DEBUG_NAME: &'static str
const REF_DEBUG_NAME: &'static str
The Debug struct name of the borrowed reference that wraps this guard
(e.g. "VideoFrameRef" or "FrameSyncVideoRef"), so the shared generic
Debug impls render the historically-correct type name.
Required Associated Types§
Required Methods§
Sourceunsafe fn free(instance: Self::Instance, frame: &mut Self::RawFrame)
unsafe fn free(instance: Self::Instance, frame: &mut Self::RawFrame)
Free a single captured frame through its owning instance.
§Safety
instancemust be the instance that producedframe(the FrameSync strategies additionally tolerate a nullinstanceby short-circuiting).framemust have been populated by a successful capture for this strategy and not already freed.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.