pub struct OnSetContext {
pub a: usize,
pub b: usize,
}Expand description
Two machine words of caller context, carried verbatim to an
OnSetParameterFn.
TWO, not one, because of the consumer that drives this API: a C or C++
registration is a FUNCTION POINTER plus a user void*, and the shim needs
both to reach the caller’s code. One word would force each wrapper to keep
a static side table mapping an index back to the pair — a second, smaller
registry with its own bound and its own exhaustion story, which is the
class phase-426 spent six work items removing.
usize, not *mut c_void: a raw pointer in this struct would strip
ParameterServer’s auto traits, and the store lives inside the executor.
The C and C++ shims cast through it and say so.
Fields§
§a: usizeFirst word. The wrappers put the user’s void* context here, so a
Rust caller with one pointer to carry uses this one and ignores b.
b: usizeSecond word. The wrappers put the C function pointer here.
Implementations§
Source§impl OnSetContext
impl OnSetContext
Sourcepub const fn new(a: usize) -> OnSetContext
pub const fn new(a: usize) -> OnSetContext
One word of context; b is zero.
Sourcepub const fn pair(a: usize, b: usize) -> OnSetContext
pub const fn pair(a: usize, b: usize) -> OnSetContext
Both words.
Trait Implementations§
Source§impl Clone for OnSetContext
impl Clone for OnSetContext
Source§fn clone(&self) -> OnSetContext
fn clone(&self) -> OnSetContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more