pub struct ObsRuntime { /* private fields */ }Expand description
Core runtime that serializes access to libobs.
Implementations§
Source§impl ObsRuntime
impl ObsRuntime
Sourcepub fn is_actor_thread(&self) -> bool
pub fn is_actor_thread(&self) -> bool
Returns true when called from the dedicated OBS actor thread.
With enable_runtime disabled there is no dedicated actor: libobs is intentionally
caller-thread-affine instead, so blocking native-completion waits on that owning thread are
not actor reentrancy and must not be rejected as such.
Sourcepub fn same_instance(&self, other: &Self) -> bool
pub fn same_instance(&self, other: &Self) -> bool
Returns true when both values belong to the same process-global OBS runtime.
Sourcepub fn run_with_obs_no_block<F>(&self, operation: F) -> Result<(), ObsError>
pub fn run_with_obs_no_block<F>(&self, operation: F) -> Result<(), ObsError>
Dispatches work without waiting for completion.
The regular actor queue is bounded. If it is full this returns
ObsError::RuntimeQueueFull instead of growing memory without bound.
Sourcepub fn run_with_obs_result<F, T>(&self, operation: F) -> Result<T, ObsError>
pub fn run_with_obs_result<F, T>(&self, operation: F) -> Result<T, ObsError>
Runs work on the OBS actor and returns its typed result.
Unlike the old implementation this does not erase the result into Any, so
there is no runtime downcast or corresponding impossible error path.
Trait Implementations§
Source§impl Clone for ObsRuntime
impl Clone for ObsRuntime
Source§impl Debug for ObsRuntime
impl Debug for ObsRuntime
Source§impl Drop for ObsRuntime
Available on crate feature enable_runtime and (crate features __test_environment) only.Test environment only: see context::test_shutdown. While no ObsContext is alive,
flush deferred cleanup before releasing this handle so that the final runtime handle is
dropped here (and joins shutdown) rather than inside a queued closure on the actor.
impl Drop for ObsRuntime
enable_runtime and (crate features __test_environment) only.Test environment only: see context::test_shutdown. While no ObsContext is alive,
flush deferred cleanup before releasing this handle so that the final runtime handle is
dropped here (and joins shutdown) rather than inside a queued closure on the actor.