If you are talking about something like begin_void
and begin_with_return
, sadly no.
It requires the return model M
to somehow be propagated through the .arg().arg().arg()
chain until,…
This is a traversal that calculates the correct GEP index of each struct field.
struct NDArrayFields<F: FieldTraversal> {
data: F::Out<Ptr<Int<Byte>>>,
itemsize: F::Out<Int<SizeT>>,
…
Passing Option<(&str, Option<M>)>
to begin
to define the return type may not be a good idea - If the function returns nothing, there is type for M
and Rust complains.
Unrelated: Is there any way to improve the situation about the lifetime signature for CallFunction
? or is this unavoidable.
I am not sure what should be changed for line 88-94.
You mean let zero = <something else?>
I am not sure if this is a good idea. I intuitively think it is less risky by keeping the generics as lax as possible even if it seems very appealing to constraint the struct, though I only first…
Are there Into implementations to convert Instance into BasicValue and Model into BasicType?
No, they could have been added but I just... didn't do that and kept using Instance::value
for…
I was adding the ones I needed to implement ndarrays. I figured I should add these ops on demand.
No. An array alloc's length is never coupled with the pointer.
I was doing something like ArraySliceValue
before, but the length value didn't have much use and often ends up being redundant.
Bounding say Item: Model<'ctx>
requires Array
itself to also have 'ctx
, then a _PhantomData
.