/// This function has some really nasty behavior if it traps in a callback.
/// Use call_with_cleanup.
This function has some really nasty behavior if it traps in a callback.
This function has some really nasty behavior if it traps in a callback .
pub async fn call<Payload, ReturnType, Witness>(
    id: CanisterId,
    method: &str,
    _: Witness,
    payload: Payload::Inner,
) -> FutureResult<ReturnType::Inner>
where
    Payload: IntoWire + NewType,
    ReturnType: FromWire + NewType,
    Witness: FnOnce(ReturnType, Payload::Inner) -> (ReturnType::Inner, Payload),
{
    let payload = Payload::from_inner(payload);
    let res: ReturnType = call_explicit(id, method, payload, Funds::zero()).await?;
    Ok(res.into_inner())
}
pub async fn call < Payload , ReturnType , Witness > ( id : CanisterId , method : & str , _ : Witness , payload : Payload :: Inner , ) -> FutureResult < ReturnType :: Inner > where Payload : IntoWire + NewType , ReturnType : FromWire + NewType , Witness : FnOnce ( ReturnType , Payload :: Inner ) -> ( ReturnType :: Inner , Payload ) , { let payload = Payload :: from_inner ( payload ) ; let res : ReturnType = call_explicit ( id , method , payload , Funds :: zero ( ) ) . await ? ; Ok ( res . into_inner ( ) ) }
This function has some really nasty behavior if it traps in a callback.
This function has some really nasty behavior if it traps in a callback .
id
CanisterId
method
Witness
payload
Payload::Inner