Schedule

Struct Schedule 

Source
pub struct Schedule<'a, P> { /* private fields */ }
Expand description

Host feature providing data to build a ScheduleHandler.

Implementations§

Source§

impl<'a, P: Worker> Schedule<'a, P>

Source

pub fn schedule_work( &self, worker_data: P::WorkData, ) -> Result<(), ScheduleError<P::WorkData>>
where P::WorkData: 'static + Send,

Request the host to call the worker thread.

If this method fails, the data is considered as untransmitted and is returned to the caller.

This method should be called from run() context to request that the host call the work() method in a non-realtime context with the given arguments.

This function is always safe to call from run(), but it is not guaranteed that the worker is actually called from a different thread. In particular, when free-wheeling (e.g. for offline rendering), the worker may be executed immediately. This allows single-threaded processing with sample accuracy and avoids timing problems when run() is executing much faster or slower than real-time.

Plugins SHOULD be written in such a way that if the worker runs immediately, and responses from the worker are delivered immediately, the effect of the work takes place immediately with sample accuracy.

Notes about the passed data: The buffer used to pass data is managed by the host. That mean the size is unknown and may be limited. So if you need to pass huge amount of data, it’s preferable to use another way, for example a sync::mpsc channel.

Trait Implementations§

Source§

impl<'a, P> Feature for Schedule<'a, P>

Source§

unsafe fn from_feature_ptr( feature: *const c_void, class: ThreadingClass, ) -> Option<Self>

Create an instance of the featurer. Read more
Source§

impl<'a, P> UriBound for Schedule<'a, P>

Source§

const URI: &'static [u8] = lv2_sys::LV2_WORKER__schedule

The URI of the type, safed as a byte slice Read more
Source§

fn uri() -> &'static CStr

Construct a CStr reference to the URI. Read more

Auto Trait Implementations§

§

impl<'a, P> Freeze for Schedule<'a, P>

§

impl<'a, P> RefUnwindSafe for Schedule<'a, P>
where P: RefUnwindSafe,

§

impl<'a, P> !Send for Schedule<'a, P>

§

impl<'a, P> !Sync for Schedule<'a, P>

§

impl<'a, P> Unpin for Schedule<'a, P>

§

impl<'a, P> UnwindSafe for Schedule<'a, P>
where P: RefUnwindSafe,

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> 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, 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.