[][src]Struct lv2_sys::LV2_Worker_Interface

#[repr(C)]pub struct LV2_Worker_Interface {
    pub work: Option<unsafe extern "C" fn(instance: LV2_Handle, respond: LV2_Worker_Respond_Function, handle: LV2_Worker_Respond_Handle, size: u32, data: *const c_void) -> LV2_Worker_Status>,
    pub work_response: Option<unsafe extern "C" fn(instance: LV2_Handle, size: u32, body: *const c_void) -> LV2_Worker_Status>,
    pub end_run: Option<unsafe extern "C" fn(instance: LV2_Handle) -> LV2_Worker_Status>,
}

Plugin Worker Interface.

This is the interface provided by the plugin to implement a worker method. The plugin's extension_data() method should return an LV2_Worker_Interface when called with LV2_WORKER__interface as its argument.

Fields

work: Option<unsafe extern "C" fn(instance: LV2_Handle, respond: LV2_Worker_Respond_Function, handle: LV2_Worker_Respond_Handle, size: u32, data: *const c_void) -> LV2_Worker_Status>

The worker method. This is called by the host in a non-realtime context as requested, possibly with an arbitrary message to handle.

A response can be sent to run() using respond. The plugin MUST NOT make any assumptions about which thread calls this method, except that there are no real-time requirements and only one call may be executed at a time. That is, the host MAY call this method from any non-real-time thread, but MUST NOT make concurrent calls to this method from several threads.

@param instance The LV2 instance this is a method on. @param respond A function for sending a response to run(). @param handle Must be passed to respond if it is called. @param size The size of data. @param data Data from run(), or NULL.

work_response: Option<unsafe extern "C" fn(instance: LV2_Handle, size: u32, body: *const c_void) -> LV2_Worker_Status>

Handle a response from the worker. This is called by the host in the run() context when a response from the worker is ready.

@param instance The LV2 instance this is a method on. @param size The size of body. @param body Message body, or NULL.

end_run: Option<unsafe extern "C" fn(instance: LV2_Handle) -> LV2_Worker_Status>

Called when all responses for this cycle have been delivered.

Since work_response() may be called after run() finished, this provides a hook for code that must run after the cycle is completed.

This field may be NULL if the plugin has no use for it. Otherwise, the host MUST call it after every run(), regardless of whether or not any responses were sent that cycle.

Trait Implementations

impl Clone for LV2_Worker_Interface[src]

impl Copy for LV2_Worker_Interface[src]

impl Debug for LV2_Worker_Interface[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.