pub struct InitContext { /* private fields */ }Expand description
Context handed to init so a plugin can schedule startup background
work before the first block. Concrete (not generic over the task
type) because init’s signature lives on the leaf trait; recover the
typed spawner with Self::tasks. Params arrive as the separate
init argument.
Implementations§
Source§impl InitContext
impl InitContext
pub fn new(tasks: Option<AnyTaskSpawner>) -> Self
Sourcepub fn with_snapshot(self, snapshot: SnapshotPublisher) -> Self
pub fn with_snapshot(self, snapshot: SnapshotPublisher) -> Self
Attach the off-thread snapshot publisher (see SnapshotPublisher).
Sourcepub fn tasks<T: Send + 'static>(&self) -> Option<TaskSpawner<T>>
pub fn tasks<T: Send + 'static>(&self) -> Option<TaskSpawner<T>>
The task spawner for task type T, or None if the plugin declared
no tasks: lane of that type on plugin!.
Sourcepub fn snapshot_publisher(&self) -> Option<SnapshotPublisher>
pub fn snapshot_publisher(&self) -> Option<SnapshotPublisher>
Handle to publish large custom state off the audio thread. Stash it
in your DSP state and call publish from a background-task handler
after your state changes. None in --shell builds; use
snapshot_into for small state, which works everywhere.
Auto Trait Implementations§
impl !RefUnwindSafe for InitContext
impl !UnwindSafe for InitContext
impl Freeze for InitContext
impl Send for InitContext
impl Sync for InitContext
impl Unpin for InitContext
impl UnsafeUnpin for InitContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more