Struct PrivateUtilityCalls
pub struct PrivateUtilityCalls<CallSelf> {
pub call_self: CallSelf,
}
Fields
call_self: CallSelfProvides type-safe methods for calling this contract's own utility functions.
Example API:
// Safety: result is unconstrained
unsafe { self.utility.call_self.some_utility_function(args) }Implementations
impl<CallSelf> PrivateUtilityCalls<CallSelf>
pub unconstrained fn call<let M: u32, let N: u32, T>(
_self: Self,
call: UtilityCall<M, N, T>,
) -> T
where
T: Deserialize
Makes a utility contract call from a private function.
Note: only same-contract utility calls are currently supported. See TODO(F-29).
Example
unsafe { self.utility.call(Token::at(self.address).get_balance_of(owner)) }
A struct that allows for ergonomic calling of utility functions from a private context.
Accessible via
self.utilityin private functions. Results are not part of any circuit proof; use them to inform logic, not as inputs to constrained assertions.Type Parameters
CallSelf: Macro-generated type for calling the contract's own utility functions (same type asCallSelfin [ContractSelfUtility])