Struct Hosted Graph Node Control
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>
impl<H: HostHandlers> HostedGraphNodeControl<H>
pub fn editor(
&mut self,
configuration: GuiConfiguration<'_>,
) -> Result<PluginEditor<'_, H>, EditorError>
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
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
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>
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.