Types with special support

bool

The rust::Bool type has an operator bool() so you can use this type directly in if statements and ternary expressions. This type also has a constructor from C++ bool so you can pass true and false to functions that take rust::Bool in input.

literals

In Rust there are many kind of literal expressions, some of them are natively supported in C++, like integer literals. For the rest, Zngur tries to support them using C++ feature called User-defined Literals.

SyntaxRust EquivalentOutput TypeStatusEnabled With
'a'_rs'a'rust::CharNot Implementedchar
"hello"_rs"hello"rust::Ref<rust::Str>Implementedstr
'a'_rs_bb'a'uint8_tNot Implementedunconditionally
"hello"_rs_bb"hello"rust::Ref<rust::Slice<uint8_t>>Not Implemented[u8]
"hello"_rs_cc"hello"rust::Ref<rust::ffi::CStr>Not Implemented::rust::ffi::CStr