Drop struct macro derive
A derive macro to free (drop) memory for structs that are used in the FFI.
Currently only c-strings (libc::c_char
) and arrays (represented as a pointer and a length field) are supported.
Example:
Will automatically create:
To view the generated output after the macro was applied, you can use cargo-expand:
$ cd filecoin-proofs
$ cargo expand --lib api::responses
Checking filecoin-proofs v0.1.0 (/home/vmx/src/pl/filecoin/rust-fil-proofs/filecoin-proofs)
Finished dev [unoptimized + debuginfo] target(s) in 0.70s
pub mod responses {
use crate::api::sector_builder::errors::SectorBuilderErr;
use crate::api::sector_builder::SectorBuilder;
use crate::api::API_POREP_PROOF_BYTES;
use drop_struct_macro_derive::DropStructMacro;
use failure::Error;
…
License
MIT or Apache 2.0