pub struct PluginRuntime { /* private fields */ }Expand description
Cloneable high-level runtime handle for host APIs available to native plugins.
Implementations§
Source§impl PluginRuntime
impl PluginRuntime
Sourcepub fn new(host: &NemoRelayNativeHostApiV1) -> Self
pub fn new(host: &NemoRelayNativeHostApiV1) -> Self
Creates a runtime handle from the host ABI table.
Sourcepub fn host_api(&self) -> &NemoRelayNativeHostApiV1
pub fn host_api(&self) -> &NemoRelayNativeHostApiV1
Returns the underlying host ABI table.
Sourcepub fn current_scope(&self) -> Result<ScopeHandle<'_>>
pub fn current_scope(&self) -> Result<ScopeHandle<'_>>
Retrieves the current scope handle.
Sourcepub fn push_scope(
&self,
name: &str,
scope_type: ScopeType,
data: Option<&Json>,
metadata: Option<&Json>,
input: Option<&Json>,
) -> Result<ScopeHandle<'_>>
pub fn push_scope( &self, name: &str, scope_type: ScopeType, data: Option<&Json>, metadata: Option<&Json>, input: Option<&Json>, ) -> Result<ScopeHandle<'_>>
Pushes a scope and emits its start event.
Sourcepub fn pop_scope(
&self,
handle: &ScopeHandle<'_>,
output: Option<&Json>,
metadata: Option<&Json>,
) -> Result<()>
pub fn pop_scope( &self, handle: &ScopeHandle<'_>, output: Option<&Json>, metadata: Option<&Json>, ) -> Result<()>
Pops a scope and emits its end event.
Sourcepub fn scope(
&self,
name: &str,
scope_type: ScopeType,
data: Option<&Json>,
metadata: Option<&Json>,
input: Option<&Json>,
) -> Result<ScopeGuard<'_>>
pub fn scope( &self, name: &str, scope_type: ScopeType, data: Option<&Json>, metadata: Option<&Json>, input: Option<&Json>, ) -> Result<ScopeGuard<'_>>
Opens a scope that is popped automatically when the guard is closed or dropped.
Sourcepub fn emit_mark(
&self,
name: &str,
data: Option<&Json>,
metadata: Option<&Json>,
) -> Result<()>
pub fn emit_mark( &self, name: &str, data: Option<&Json>, metadata: Option<&Json>, ) -> Result<()>
Emits a mark event under the current scope.
Sourcepub fn create_scope_stack(&self) -> Result<ScopeStack<'_>>
pub fn create_scope_stack(&self) -> Result<ScopeStack<'_>>
Creates a new independent scope stack.
Sourcepub fn capture_scope_stack_thread(&self) -> Result<ScopeStackBinding<'_>>
pub fn capture_scope_stack_thread(&self) -> Result<ScopeStackBinding<'_>>
Captures the current thread-local scope-stack binding.
Sourcepub fn scope_stack_active(&self) -> bool
pub fn scope_stack_active(&self) -> bool
Returns whether the current context has an explicitly active scope stack.
Sourcepub fn bind_scope_stack_thread<'a>(
&'a self,
stack: &'a ScopeStack<'a>,
) -> Result<ThreadScopeStackGuard<'a>>
pub fn bind_scope_stack_thread<'a>( &'a self, stack: &'a ScopeStack<'a>, ) -> Result<ThreadScopeStackGuard<'a>>
Binds stack to the current OS thread until the returned guard is dropped.
Trait Implementations§
Source§impl Clone for PluginRuntime
impl Clone for PluginRuntime
Source§fn clone(&self) -> PluginRuntime
fn clone(&self) -> PluginRuntime
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PluginRuntime
impl RefUnwindSafe for PluginRuntime
impl Send for PluginRuntime
impl Sync for PluginRuntime
impl Unpin for PluginRuntime
impl UnsafeUnpin for PluginRuntime
impl UnwindSafe for PluginRuntime
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