<@U06A03HV1> Why does `scheduler_create` returns a...
# development
a
@witty-crayon-22786 Why does
scheduler_create
returns a raw pointer not a
Handle
wrapping the pointer?
Context: https://github.com/pantsbuild/pants/pull/8275 has a massive TODO because of that question
w
hm... just historical reasons, i think?
it was probably the absolute first method that existed
oh. wait. no
it returns a raw pointer because it is not a python object
to return a Handle you'd have to "convert" it into a python object
a
Ok, so for that PR I should probably make a one off
NonPyResult
that happens to be layout-identical to
PyResult
?
w
or use some other C calling convention... yea, i think so.
a
Cool, will do 🙂 Thanks!
w
although, i don't know if
NonPyResult
would be generic, unfortunately.
a
I’m imagining:
Copy code
struct NonPyResult {
  is_throw: bool,
  throw: Option<Handle>,
  pointer: Option<*const raw::c_void>,
}
w
RawResult
or something.
yea
a
Pushed - please review at your convenience!
w
@average-vr-56795: commented
(two comments)