AUDIO
Source snapshot · 12 October 2026

API reference / ravet_host::HostedGraphNodeControl

Struct HostedGraphNodeControl 

pub struct HostedGraphNodeControl<H: HostHandlers> { /* private fields */ }
Expand description

Main-thread native instance owner. Retain until its graph/node has stopped on audio and deactivated/dropped on control, then reclaim the stopped token. Dropping early follows Clack’s protective leak policy, not wrong-thread native destruction. Deferred callbacks require explicit service; editing/rebuild follows returned inactive instance ownership. No polling/event loop is created.

use ravet_host::{HostedGraphNodeControl, RequestHost};
fn require_send<T: Send>() {}
require_send::<HostedGraphNodeControl<RequestHost>>();

Implementations§

§

impl<H: HostHandlers> HostedGraphNodeControl<H>

pub fn editor( &mut self, configuration: GuiConfiguration<'_>, ) -> Result<PluginEditor<'_, H>, EditorError>

Create a guarded native editor on the plugin/OS main thread, while the separately owned audio node may run. The guard exclusively borrows this control’s retained instance, preventing reclaim/drop until GUI destruction. Native parent lifetime and event-loop/request servicing stay explicit.

use ravet_host::{HostedGraphNodeControl, RequestHost};
use clack_extensions::gui::GuiConfiguration;
fn retire(control: &mut HostedGraphNodeControl<RequestHost>, config: GuiConfiguration<'_>) {
    let editor = control.editor(config).unwrap();
    control.reclaim(); // editor still owns the exclusive instance borrow
    drop(editor);
}

pub fn reclaim(&mut self) -> bool

Main-thread deactivation, at most once, after graph/node control retirement. Returns false while the token has not returned or was already reclaimed.

pub fn service_callback(&mut self, requests: &HostRequests) -> bool

Service at most one deferred core callback on main. The mailbox must be the one installed in this instance’s host handlers; restart/process requests remain consumer-owned. No polling/event loop is created.

pub fn into_instance(self) -> Result<PluginInstance<H>, Self>

After reclaim, recover the inactive main instance for state/parameter editing or a fresh activation/node. Otherwise retain complete ownership.

pub fn is_deactivated(&self) -> bool

pub fn statistics(&self) -> HostedGraphNodeStatistics

Trait Implementations§

§

impl<H: HostHandlers> Drop for HostedGraphNodeControl<H>

§

fn drop(&mut self)

Executes the destructor for this type. Read more
§

fn pin_drop(self: Pin<&mut Self>)

Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.