Skip to main content

ThreadSafeArgContext

Trait ThreadSafeArgContext 

pub trait ThreadSafeArgContext: ThreadSafeSealed {
    // Required method
    fn guarantee_thread_safe(&self);
}
Expand description

Runtime restrictions for AsArg to guarantee thread safe usage of engine types.

For thread safe types that implement Send + Sync this trait is implemented as a no-op. For non thread-safe engine types, a runtime check is performed that ensures the types can only be passed to the engine on the main thread.

Required Methods§

fn guarantee_thread_safe(&self)

Panics if the value is being used in a non thread-safe context.

Implementations on Foreign Types§

§

impl ThreadSafeArgContext for &String

§

impl ThreadSafeArgContext for &[Variant]

§

impl<T> ThreadSafeArgContext for Option<T>

Implementors§