Expand description
Library of macros for FFI (adapting Rust to other programming languages).
Modules§
Macros§
- c_
check_ exact_ buffer_ size - Check whether a C buffer pointer has the expected buffer size.
- c_
safe_ bytes_ to_ c_ char_ pointer - Converts Rust bytes to C char pointer, and returns NULL if failed.
- c_
safe_ bytes_ to_ proto_ with_ error_ value - Converts Rust bytes to Rust proto, and returns a specified error value if failed.
- c_
safe_ c_ char_ pointer_ to_ bytes - Converts C char pointer to Rust bytes, and returns NULL if failed.
- c_
safe_ c_ char_ pointer_ to_ bytes_ utf8 - Converts C char pointer to Rust bytes without decoding, and returns NULL if failed.
- c_
safe_ c_ char_ pointer_ to_ bytes_ utf8_ with_ error_ value - Converts C char pointer to Rust bytes without decoding, and returns a specified error value if failed.
- c_
safe_ c_ char_ pointer_ to_ bytes_ with_ error_ value - Converts C char pointer to Rust bytes, and returns a specified error value if failed.
- c_
safe_ c_ char_ pointer_ to_ proto - Converts C char pointer to Rust proto, and returns NULL if failed.
- c_
safe_ c_ char_ pointer_ to_ proto_ with_ error_ value - Converts C char pointer to Rust proto, and returns a specified error value if failed.
- c_
safe_ c_ char_ pointer_ to_ string - Converts C char pointer to Rust string, and returns NULL if failed.
- c_
safe_ c_ char_ pointer_ to_ string_ with_ error_ value - Converts C char pointer to Rust string, and returns a specified error value if failed.
- c_
safe_ proto_ to_ c_ char_ pointer - Converts Rust protobuf to C char pointer, and returns NULL if failed.
- c_
safe_ return - Returns C data, and returns NULL if any exception occurred.
- c_
safe_ return_ with_ error_ value - Returns C data, and returns a specified error value if any exception occurred.
- c_
safe_ string_ to_ bytes_ with_ error_ value - Converts Rust String to Rust bytes, and returns a specified error value if failed.
- c_
safe_ string_ to_ c_ char_ pointer - Converts Rust string to C char pointer, and returns NULL if failed.
- c_
safe_ string_ to_ c_ char_ pointer_ with_ error_ value - Converts Rust string to C char pointer, and returns a specified error value if failed.
- encodable_
struct_ to_ string - Converts encodable Rust struct to Rust string, which a implemented encode function.
- java_
safe_ bytes_ to_ jbyte_ array - Converts Rust String to Java byte array, and returns an error object if failed.
- java_
safe_ bytes_ to_ jbytebuffer - Converts Rust String to Java ByteBuffer, and returns an error object if failed.
- java_
safe_ bytes_ to_ pb - Converts Rust bytes to Rust protobuf, and returns an error object if failed.
- java_
safe_ jbytes_ to_ bytes - Converts Java byte array to Rust bytes, and returns an error object if failed.
- java_
safe_ jstring_ to_ bytes - Converts Java String to Rust bytes, and returns an error object if failed.
- java_
safe_ jstring_ to_ bytes_ utf8 - Converts Java String to Rust bytes without decoding, and returns an error object if failed.
- java_
safe_ jstring_ to_ pb - Converts Java String to Rust protobuf, and returns an error object if failed.
- java_
safe_ jstring_ to_ string - Converts Java String to Rust String, and returns an error object if failed.
- java_
safe_ pb_ to_ bytes - Converts Rust protobuf to Rust bytes, and returns an error object if failed.
- java_
safe_ set_ boolean_ field - Sets a field of boolean type, and returns an error object if failed.
- java_
safe_ set_ byte_ array_ field - Sets a field of bytes type, and returns an error object if failed.
- java_
safe_ set_ byte_ field - Sets a field of byte type, and returns an error object if failed.
- java_
safe_ set_ bytes_ field - Sets a field of bytes type, and returns an error object if failed.
- java_
safe_ set_ encoded_ pb_ field - Sets a field of encoded protobuf type, and returns an error object if failed.
- java_
safe_ set_ field - Sets a field of a Java object, and returns an error object if failed.
- java_
safe_ set_ int_ field - Sets a field of int type, and returns an error object if failed.
- java_
safe_ set_ long_ field - Sets a field of long type, and returns an error object if failed.
- java_
safe_ set_ string_ field - Sets a field of String type, and returns an error object if failed.
- java_
safe_ string_ to_ bytes - Converts Rust string to Rust bytes, and returns an error object if failed.
- java_
safe_ string_ to_ jstring - Converts Rust String to Java String, and returns an error object if failed.