Struct ic_utils::interfaces::management_canister::builders::InstallBuilder
source · pub struct InstallBuilder<'agent, 'canister, 'builder> { /* private fields */ }
Expand description
A builder for a ManagementCanister::install
call. This automatically selects one-shot installation or chunked installation depending on module size.
§Warnings
This will clear chunked code storage if chunked installation is used. Do not use with canisters that you are manually uploading chunked code to.
Implementations§
source§impl<'agent: 'canister, 'canister: 'builder, 'builder> InstallBuilder<'agent, 'canister, 'builder>
impl<'agent: 'canister, 'canister: 'builder, 'builder> InstallBuilder<'agent, 'canister, 'builder>
sourcepub fn builder(
canister: &'canister ManagementCanister<'agent>,
canister_id: &Principal,
wasm: &'builder [u8]
) -> Self
pub fn builder( canister: &'canister ManagementCanister<'agent>, canister_id: &Principal, wasm: &'builder [u8] ) -> Self
Create a canister installation builder.
sourcepub fn with_arg<Argument: CandidType>(self, arg: Argument) -> Self
pub fn with_arg<Argument: CandidType>(self, arg: Argument) -> 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, tuple: impl ArgumentEncoder) -> Self
pub fn with_args(self, tuple: 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, arg: Vec<u8>) -> Self
pub fn with_raw_arg(self, arg: Vec<u8>) -> Self
Set the argument passed in to the canister with raw bytes. Can be called at most once.
sourcepub fn with_mode(self, mode: InstallMode) -> Self
pub fn with_mode(self, mode: InstallMode) -> Self
Pass in the InstallMode.
sourcepub async fn call_and_wait(self) -> Result<(), AgentError>
pub async fn call_and_wait(self) -> Result<(), AgentError>
Invoke the installation process. This may result in many calls which may take several seconds;
use call_and_wait_with_progress
if you want progress reporting.
sourcepub async fn call_and_wait_with_progress(
self
) -> impl Stream<Item = Result<(), AgentError>> + 'builder
pub async fn call_and_wait_with_progress( self ) -> impl Stream<Item = Result<(), AgentError>> + 'builder
Invoke the installation process. The returned stream must be iterated to completion; it is used to track progress,
as installation may take arbitrarily long, and is intended to be passed to functions like indicatif::ProgressBar::wrap_stream
.
There are exactly size_hint().0
steps.