pub struct InstallChunkedCodeBuilder<'agent, 'canister> { /* private fields */ }Expand description
A builder for an install_chunked_code call.
Implementations§
Source§impl<'agent: 'canister, 'canister> InstallChunkedCodeBuilder<'agent, 'canister>
impl<'agent: 'canister, 'canister> InstallChunkedCodeBuilder<'agent, 'canister>
Sourcepub fn builder(
canister: &'canister Canister<'agent>,
target_canister: Principal,
wasm_module_hash: &[u8],
) -> Self
pub fn builder( canister: &'canister Canister<'agent>, target_canister: Principal, wasm_module_hash: &[u8], ) -> Self
Create an InstallChunkedCodeBuilder.
Sourcepub fn with_chunk_hashes(self, chunk_hashes: Vec<ChunkHash>) -> Self
pub fn with_chunk_hashes(self, chunk_hashes: Vec<ChunkHash>) -> Self
Set the chunks to install. These must previously have been set with ManagementCanister::upload_chunk.
Sourcepub fn with_store_canister(self, store_canister: Principal) -> Self
pub fn with_store_canister(self, store_canister: Principal) -> Self
Set the canister to pull uploaded chunks from. By default this is the same as the target canister.
Sourcepub fn with_arg(self, argument: impl CandidType) -> Self
pub fn with_arg(self, argument: impl CandidType) -> Self
Set the argument to the installation, which will be passed to the init method of the canister. Can be called at most once.
Sourcepub fn with_args(self, argument: impl ArgumentEncoder) -> Self
pub fn with_args(self, argument: impl ArgumentEncoder) -> Self
Set the argument with multiple arguments as tuple to the installation, which will be passed to the init method of the canister. Can be called at most once.
Sourcepub fn with_raw_arg(self, argument: Vec<u8>) -> Self
pub fn with_raw_arg(self, argument: Vec<u8>) -> Self
Set the argument passed in to the canister with raw bytes. Can be called at most once.
Sourcepub fn with_install_mode(self, mode: CanisterInstallMode) -> Self
pub fn with_install_mode(self, mode: CanisterInstallMode) -> Self
Set the CanisterInstallMode.
Sourcepub fn build(self) -> Result<impl 'agent + AsyncCall<Value = ()>, AgentError>
pub fn build(self) -> Result<impl 'agent + AsyncCall<Value = ()>, AgentError>
Create an AsyncCall implementation that, when called, will install the canister.
Sourcepub async fn call(self) -> Result<CallResponse<()>, AgentError>
pub async fn call(self) -> Result<CallResponse<()>, AgentError>
Make the call. This is equivalent to AsyncCall::call.
Sourcepub async fn call_and_wait(self) -> Result<(), AgentError>
pub async fn call_and_wait(self) -> Result<(), AgentError>
Make the call. This is equivalent to AsyncCall::call_and_wait.
Trait Implementations§
Source§impl<'agent, 'canister: 'agent> AsyncCall for InstallChunkedCodeBuilder<'agent, 'canister>
impl<'agent, 'canister: 'agent> AsyncCall for InstallChunkedCodeBuilder<'agent, 'canister>
Source§fn call<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = Result<CallResponse<()>, AgentError>> + 'async_trait>>where
Self: 'async_trait,
fn call<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = Result<CallResponse<()>, AgentError>> + 'async_trait>>where
Self: 'async_trait,
RequestId. Waiting on the request Id must be
managed by the caller using the Agent directly. Read moreSource§fn call_and_wait<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + 'async_trait>>where
Self: 'async_trait,
fn call_and_wait<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + 'async_trait>>where
Self: 'async_trait,
Source§fn and_then<'a, Out2, R, AndThen>(
self,
and_then: AndThen,
) -> AndThenAsyncCaller<'a, Self::Value, Out2, Self, R, AndThen>
fn and_then<'a, Out2, R, AndThen>( self, and_then: AndThen, ) -> AndThenAsyncCaller<'a, Self::Value, Out2, Self, R, AndThen>
Source§fn map<'a, Out, Map>(
self,
map: Map,
) -> MappedAsyncCaller<'a, Self::Value, Out, Self, Map>
fn map<'a, Out, Map>( self, map: Map, ) -> MappedAsyncCaller<'a, Self::Value, Out, Self, Map>
.and_then(|x| async { map(x) }).