Skip to main content

Node

Trait Node 

Source
pub trait Node:
    Sized
    + Send
    + Sync
    + Sealed {
    type FrameType: Frame;

    // Required methods
    fn api(&self) -> Api;
    fn as_ptr(&self) -> *mut VSNode;
    fn get_frame_filter(
        &self,
        n: i32,
        ctx: &mut FrameContext,
    ) -> Self::FrameType;

    // Provided methods
    fn set_linear_filter(&mut self) -> i32 { ... }
    fn set_cache_mode(&mut self, mode: CacheMode) { ... }
    fn set_cache_options(
        &mut self,
        fixed_size: i32,
        max_size: i32,
        max_history_size: i32,
    ) { ... }
    fn get_frame(&self, n: i32) -> Result<Self::FrameType, CString> { ... }
    unsafe fn get_frame_async(
        &self,
        n: i32,
        data: *mut c_void,
        callback: VSFrameDoneCallback,
    ) { ... }
}

Required Associated Types§

Required Methods§

Source

fn api(&self) -> Api

Source

fn as_ptr(&self) -> *mut VSNode

Source

fn get_frame_filter(&self, n: i32, ctx: &mut FrameContext) -> Self::FrameType

Provided Methods§

Source

fn set_linear_filter(&mut self) -> i32

Source

fn set_cache_mode(&mut self, mode: CacheMode)

Source

fn set_cache_options( &mut self, fixed_size: i32, max_size: i32, max_history_size: i32, )

Source

fn get_frame(&self, n: i32) -> Result<Self::FrameType, CString>

§Errors

Return the internal error message if the frame is not ready.

Source

unsafe fn get_frame_async( &self, n: i32, data: *mut c_void, callback: VSFrameDoneCallback, )

§Safety

The caller must ensure that:

  • data is a valid pointer to the data needed by the callback
  • callback is a valid function pointer that safely handles the frame data
  • The callback and data remain valid until the frame processing is complete

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§