vapoursynth/plugins/
frame_context.rs1use std::marker::PhantomData;
2use std::ptr::NonNull;
3use vapoursynth_sys as ffi;
4
5#[derive(Debug, Clone, Copy)]
7pub struct FrameContext<'a> {
8 handle: NonNull<ffi::VSFrameContext>,
9 _owner: PhantomData<&'a ()>,
10}
11
12impl<'a> FrameContext<'a> {
13 #[inline]
18 pub(crate) unsafe fn from_ptr(handle: *mut ffi::VSFrameContext) -> Self {
19 Self {
20 handle: NonNull::new_unchecked(handle),
21 _owner: PhantomData,
22 }
23 }
24
25 #[inline]
27 pub(crate) fn ptr(self) -> *mut ffi::VSFrameContext {
28 self.handle.as_ptr()
29 }
30}