char is not supported as function argument
error[cxxbridge]: unsupported type: char
┌─ tokenizers-cpp/pre_tokenizers.rs:56:52
│
56 │ fn char_delimiter_pre_tokenizer(delimiter: char) -> Box<PreTokenizer>;
│ ^^^^ unsupported type
Is the reason that some u32 values are not valid chars? If so, this could be specified in the error message.
It seems consistent with rust::Str/String to add the class rust::Char with Char(char32_t) constructor throwing exception on an invalid value and an implicit operator char32_t().
Hello @alexeyr,
I don't think char is supported, but I think you'd want std::os::raw::c_char instead.
I think that will get translated into a char in C++ (although I haven't done it myself, yet).
I personally find looking at the cxx tests to be very helpful when looking for tested data type combinations. https://github.com/dtolnay/cxx/blob/master/tests/ffi/lib.rs
@david-cattermole I was interested in going the other way around, wrapping existing Rust code using char (and expecting it to translate to char32_t). So my workaround it to use u32 in the bridge, and wrap/unwrap it manually.
I would also be interested in having support for char
~~cbdingen for instance support chars and use char => uint32_t conversion for the rust -> cpp side. For the cpp -> rust I think the simple fix of converting to char via char::from_u32(uint32_t).expect("Valid char") would enough for a first implementation. ~~
Edit: Now that c++11 is the minimal supported version, it should be trivial to map it to char32_t