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>

source

pub fn builder( canister: &'canister ManagementCanister<'agent>, canister_id: &Principal, wasm: &'builder [u8] ) -> Self

Create a canister installation builder.

source

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.

source

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.

source

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.

source

pub fn with_mode(self, mode: InstallMode) -> Self

Pass in the InstallMode.

source

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.

source

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.

Trait Implementations§

source§

impl<'agent, 'canister, 'builder> Debug for InstallBuilder<'agent, 'canister, 'builder>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'agent, 'canister, 'builder> Freeze for InstallBuilder<'agent, 'canister, 'builder>

§

impl<'agent, 'canister, 'builder> !RefUnwindSafe for InstallBuilder<'agent, 'canister, 'builder>

§

impl<'agent, 'canister, 'builder> Send for InstallBuilder<'agent, 'canister, 'builder>

§

impl<'agent, 'canister, 'builder> Sync for InstallBuilder<'agent, 'canister, 'builder>

§

impl<'agent, 'canister, 'builder> Unpin for InstallBuilder<'agent, 'canister, 'builder>

§

impl<'agent, 'canister, 'builder> !UnwindSafe for InstallBuilder<'agent, 'canister, 'builder>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V