[−][src]Trait ffishim::types::Behavior
The behavior of a Type
as needed to generate the ffi shim.
Required methods
fn is(&self, sty: &Type) -> bool
Returns true
if this behavior is fit to handle the given sty
.
fn fold(&self, sty: Type) -> Type
Transforms the given Type
into its shim equivalent. For example:
String
->*mut libc::c_char
u32
->libc::c_uint
- ...
fn try_into(&self, sty: &Type, name: Expr) -> Expr
Returns an Expr
ession that mutates the shim type into the original one.
fn from(&self, sty: &Type, name: Expr) -> Expr
Returns an Expr
ession that mutates the original type into its shim equivalent.
fn free(&self, sty: &Type, name: Expr) -> Option<Expr>
Returns an Expr
ession that frees an expression of the given type.