Closed ColonelThirtyTwo closed 4 years ago
Hi @ColonelThirtyTwo!
If that can be useful to you, we could add an into_inner
method to ShapeHandle
:
impl<N: RealField> ShapeHandle<N> {
pub fn into_inner(self) -> Arc<dyn Shape<N>> {
self.0
}
}
Doing some C interop.
ShapeHandle
appears to wrapArc<dyn Shape>
, and while there's a method to convert anArc<dyn Shape>
to aShapeHandle
, there's no way to get theArc<dyn Shape>
from an existingShapeHandle
.I'd like this because then I can expose the pointer provided by
Arc::into_raw
to the C API, however since I can't do that, I have to box aShapeHandle
, which adds another layer of allocation and indirection.