Macro ffi_support::implement_into_ffi_by_json[][src]

macro_rules! implement_into_ffi_by_json {
    ($($T:ty),* $(,)*) => { ... };
}

Implements [IntoFfi] for the provided types (more than one may be passed in) by converting to the type to a JSON string.

Additionally, most of the time we recomment using this crate’s protobuf support, instead of JSON.

This is typically going to be used from the “Rust component”, and not the “FFI component” (see the top level crate documentation for more information).

Note: Each type passed in must implement or derive serde::Serialize.

Note: for this to works, the crate it’s called in must depend on serde and serde_json.

Panics

The [IntoFfi] implementation this macro generates may panic in the following cases:

These cases are both rare enough that this still seems fine for the majority of uses.