pub fn new(
        id: CallTableId,
        name: &'static str,
        args: Vec<Arg>,
        ccall: fn(ctx: &mut[Arg]) -> CallInfo
        ) -> Call
    {
        Call {
            id : id,
            name : name,
            einfo : CallInfo::fail(0),//0 should be undefined kin!
            total : 0,
            allowed : 0,
            success : 0,
            args : args,
            ccall : ccall,
            n_attempts : 0,
        }
    }
/// note : all advanced logic should be in fuzzy_obj.do_fuzz(), not in call implementation
///
/// implies : Call object is just templated builder
///
/// # Example
/// ```
/// fn test_callee(a: &mut test_struct, b: &mut u32) -> CallInfo {
///     a.a += 1;
///     *b += 3;
///     true
/// }
///
/// impl Call {
///     pub fn test_call() -> Call {
///         Call::new(
///             CallTableId::Id(TestCalls::Dummy as u64),
///             "test-call",
///             vec![
///                 Arg::memory_arg(
///                     Box::new(ArgComposite::test_arg_ex(mem::size_of::<test_struct>()))),
///                 Arg::primitive_arg(
///                     Box::new(ArgComposite::test_arg_ex(4)))
///             ],
///             |args| {
///                 if let [a, b] = &args[..] {
///                     test_callee(
///                         a[0].load_unsafe(),
///                         b[0].load_unsafe())
///                 }
///             })
///     }
/// }
/// ```
note : all advanced logic should be in fuzzy_obj.do_fuzz(), not in call implementation
implies : Call object is just templated builder
note : all advanced logic should be in fuzzy_obj . do_fuzz () not in call implementation implies : Call object is just templated builder
pub fn new(
        id: CallTableId,
        name: &'static str,
        args: Vec<Arg>,
        ccall: fn(ctx: &mut[Arg]) -> CallInfo
        ) -> Call
    {
        Call {
            id : id,
            name : name,
            einfo : CallInfo::fail(0),//0 should be undefined kin!
            total : 0,
            allowed : 0,
            success : 0,
            args : args,
            ccall : ccall,
            n_attempts : 0,
        }
    }
pub fn new ( id : CallTableId , name : & ' static str , args : Vec < Arg > , ccall : fn ( ctx : & mut [ Arg ] ) -> CallInfo ) -> Call { Call { id : id , name : name , einfo : CallInfo :: fail ( 0 ) , //0 should be undefined kin! total : 0 , allowed : 0 , success : 0 , args : args , ccall : ccall , n_attempts : 0 , } }
note : all advanced logic should be in fuzzy_obj.do_fuzz(), not in call implementation
implies : Call object is just templated builder
note : all advanced logic should be in fuzzy_obj . do_fuzz () not in call implementation implies : Call object is just templated builder
id
CallTableId
name
&'static str
args
Vec<Arg>
ccall
fn(ctx: &mut[Arg]) -> CallInfo
ctx
&mut[Arg]
id
CallTableId
name
&'static str
args
Vec<Arg>
ccall
fn(ctx: &mut[Arg]) -> CallInfo
ctx
&mut[Arg]
example


impl Call {
pub fn test_call() -> Call {
Call::new(
CallTableId::Id(TestCalls::Dummy as u64),
"test-call",
vec![
Arg::memory_arg(
Box::new(ArgComposite::test_arg_ex(mem::size_of::()))),
Arg::primitive_arg(
Box::new(ArgComposite::test_arg_ex(4)))
],
|args| {
if let [a, b] = &args[..] {
test_callee(
a[0].load_unsafe(),
b[0].load_unsafe())
}
})
}
}
```
impl Call { pub fn test_call () - > Call { Call :: new ( CallTableId :: Id ( TestCalls :: Dummy as u64 ) " test - call " vec! [ Arg :: memory_arg ( Box :: new ( ArgComposite :: test_arg_ex ( mem :: size_of :: () ))) Arg :: primitive_arg ( Box :: new ( ArgComposite :: test_arg_ex ( 4 ))) ] |args| { if let [ a b ] = &args [ .. ] { test_callee ( a [ 0 ] . load_unsafe () b [ 0 ] . load_unsafe () ) } } ) } } ` ` `