David Tolnay
David Tolnay
This is the limitation documented in the writeup. https://github.com/dtolnay/case-studies/blob/2d215ae2caca470bf92534b77eb63904a08a9be4/autoref-specialization/README.md#limitations Since `get_toy_example` is not a macro, you only get associated item resolution (method resolution, associated type projection) based on the trait...
I am interested for this crate to support this, but I will not be able to prioritize iterating on the implementation in the near term.
You can also remove the exclusive reference to `self` and use a shared reference. Getting the pointer from a unique_ptr doesn't require that the caller has exclusive access to the...
Maybe with a [partial template specialization](https://en.cppreference.com/w/cpp/language/partial_specialization) in cxx.h which applies to instantiations of `rust::Slice`? ```cpp template class Slice final { /* uses reference_wrapper internally for this specialization */ }; ```...
Right. That is how the standard library and libc do C integer types. https://doc.rust-lang.org/1.50.0/std/os/raw/index.html https://docs.rs/libc/0.2.91/libc/#types Canonically the rust_fn implementation would be written using cxx::num::char32_t though.
How about setting up some Cargo features to opt in to bindings beyond the basic set? Downstream could enable them as: ```toml # Cargo.toml [dependencies] cxx = { version =...
You need to add `impl SharedPtr {}` inside the ffi module that defines CppFoo in order for SharedPtr\ to work, if SharedPtr\ isn't otherwise already mentioned in that module. See...
Passing function pointers from Rust to C++ was implemented in #79 + #85. It remains to implement passing the reverse direction.
Yes, that is effectively equivalent to the semantics of [`Cell`](https://doc.rust-lang.org/std/cell/struct.Cell.html). You'd have to make sure to follow all the same restrictions as `Cell`, i.e. not expose references to the `mutable`...
Yes, you'd need to give some Rust type which has a matching layout as TThostFtdcBrokerIDType. For example: ```rust use std::os::raw::c_char; use cxx::{type_id, ExternType}; #[repr(transparent)] pub struct TThostFtdcBrokerIDType([c_char; 11]); unsafe impl...