Struct ic_utils::canister::SyncCallBuilder
source · pub struct SyncCallBuilder<'agent, 'canister: 'agent> { /* private fields */ }Expand description
A builder for a synchronous call (ie. query) to the Internet Computer.
See SyncCaller for a description of this structure once built.
Implementations§
source§impl<'agent, 'canister: 'agent> SyncCallBuilder<'agent, 'canister>
impl<'agent, 'canister: 'agent> SyncCallBuilder<'agent, 'canister>
sourcepub fn with_arg<Argument>(
self,
arg: Argument
) -> SyncCallBuilder<'agent, 'canister>where
Argument: CandidType + Sync + Send,
pub fn with_arg<Argument>( self, arg: Argument ) -> SyncCallBuilder<'agent, 'canister>where Argument: CandidType + Sync + Send,
Add an argument to the candid argument list. This requires Candid arguments, if there is a raw argument set (using [with_arg_raw]), this will fail.
sourcepub fn with_value_arg(self, arg: IDLValue) -> SyncCallBuilder<'agent, 'canister>
pub fn with_value_arg(self, arg: IDLValue) -> SyncCallBuilder<'agent, 'canister>
Add an argument to the candid argument list. This requires Candid arguments, if there is a raw argument set (using [with_arg_raw]), this will fail. TODO: make this method unnecessary https://github.com/dfinity/agent-rs/issues/132
sourcepub fn with_arg_raw(self, arg: Vec<u8>) -> SyncCallBuilder<'agent, 'canister>
pub fn with_arg_raw(self, arg: Vec<u8>) -> SyncCallBuilder<'agent, 'canister>
Replace the argument with raw argument bytes. This will overwrite the current argument set, so calling this method twice will discard the first argument.
sourcepub fn with_effective_canister_id(
self,
canister_id: Principal
) -> SyncCallBuilder<'agent, 'canister>
pub fn with_effective_canister_id( self, canister_id: Principal ) -> SyncCallBuilder<'agent, 'canister>
Sets the effective canister ID of the destination.
sourcepub fn build<Output>(self) -> SyncCaller<'canister, Output>where
Output: for<'de> ArgumentDecoder<'de> + Send + Sync,
pub fn build<Output>(self) -> SyncCaller<'canister, Output>where Output: for<'de> ArgumentDecoder<'de> + Send + Sync,
Builds an SyncCaller from this builder’s state.