LV2_Worker_Interface

Struct LV2_Worker_Interface 

Source
#[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>, }
Expand description

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§

Source§

impl Clone for LV2_Worker_Interface

Source§

fn clone(&self) -> LV2_Worker_Interface

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LV2_Worker_Interface

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for LV2_Worker_Interface

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.