Skip to main content

UpdateSettingsBuilder

Struct UpdateSettingsBuilder 

Source
pub struct UpdateSettingsBuilder<'agent, 'canister: 'agent> { /* private fields */ }
Expand description

A builder for an update_settings call.

Implementations§

Source§

impl<'agent, 'canister: 'agent> UpdateSettingsBuilder<'agent, 'canister>

Source

pub fn builder( canister: &'canister Canister<'agent>, canister_id: &Principal, ) -> Self

Create an UpdateCanister builder, which is also an AsyncCall implementation.

Source

pub fn with_controller<C, E>(self, controller: C) -> Self
where E: Display, C: TryInto<Principal, Error = E>,

Pass in a controller for the canister. Can be called multiple times to add multiple controllers.

Source

pub fn with_compute_allocation<C, E>(self, compute_allocation: C) -> Self
where E: Display, C: TryInto<ComputeAllocation, Error = E>,

Pass in a compute allocation value for the canister.

Source

pub fn with_memory_allocation<C, E>(self, memory_allocation: C) -> Self
where E: Display, C: TryInto<MemoryAllocation, Error = E>,

Pass in a memory allocation value for the canister.

Source

pub fn with_freezing_threshold<C, E>(self, freezing_threshold: C) -> Self
where E: Display, C: TryInto<FreezingThreshold, Error = E>,

Pass in a freezing threshold value for the canister.

Source

pub fn with_reserved_cycles_limit<C, E>(self, limit: C) -> Self
where E: Display, C: TryInto<ReservedCyclesLimit, Error = E>,

Pass in a reserved cycles limit value for the canister.

Source

pub fn with_wasm_memory_limit<C, E>(self, wasm_memory_limit: C) -> Self
where E: Display, C: TryInto<WasmMemoryLimit, Error = E>,

Pass in a Wasm memory limit value for the canister.

Source

pub fn with_wasm_memory_threshold<C, E>(self, wasm_memory_threshold: C) -> Self
where E: Display, C: TryInto<WasmMemoryLimit, Error = E>,

Pass in a Wasm memory threshold value for the canister.

Source

pub fn with_log_memory_limit<C, E>(self, log_memory_limit: C) -> Self
where E: Display, C: TryInto<LogMemoryLimit, Error = E>,

Pass in a log memory limit value for the canister.

Source

pub fn with_log_visibility<C, E>(self, log_visibility: C) -> Self
where E: Display, C: TryInto<LogVisibility, Error = E>,

Pass in a log visibility setting for the canister.

Source

pub fn with_environment_variables<C, E>(self, environment_variables: C) -> Self
where E: Display, C: TryInto<Vec<EnvironmentVariable>, Error = E>,

Pass in environment variables for the canister.

Source

pub fn build(self) -> Result<impl 'agent + AsyncCall<Value = ()>, AgentError>

Create an AsyncCall implementation that, when called, will update a canisters settings.

Source

pub async fn call(self) -> Result<CallResponse<()>, AgentError>

Make a call. This is equivalent to the AsyncCall::call.

Source

pub async fn call_and_wait(self) -> Result<(), AgentError>

Make a call. This is equivalent to the AsyncCall::call_and_wait.

Trait Implementations§

Source§

impl<'agent, 'canister: 'agent> AsyncCall for UpdateSettingsBuilder<'agent, 'canister>

Source§

type Value = ()

The return type of the Candid function being called.
Source§

fn call<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<CallResponse<()>, AgentError>> + Send + 'async_trait>>
where Self: 'async_trait,

Execute the call, but returns the RequestId. Waiting on the request Id must be managed by the caller using the Agent directly. Read more
Source§

fn call_and_wait<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send + 'async_trait>>
where Self: 'async_trait,

Execute the call, and wait for an answer using an exponential-backoff strategy. The return type is encoded in the trait.
Source§

fn and_then<'a, Out2, R, AndThen>( self, and_then: AndThen, ) -> AndThenAsyncCaller<'a, Self::Value, Out2, Self, R, AndThen>
where Self: Sized + Send + 'a, Out2: for<'de> ArgumentDecoder<'de> + Send + 'a, R: Future<Output = Result<Out2, AgentError>> + Send + 'a, AndThen: Send + Fn(Self::Value) -> R + 'a,

Apply a transformation function after the call has been successful. The transformation is applied with the result. Read more
Source§

fn map<'a, Out, Map>( self, map: Map, ) -> MappedAsyncCaller<'a, Self::Value, Out, Self, Map>
where Self: Sized + Send + 'a, Out: for<'de> ArgumentDecoder<'de> + Send + 'a, Map: Send + Fn(Self::Value) -> Out + 'a,

Apply a transformation function after the call has been successful. Equivalent to .and_then(|x| async { map(x) }).
Source§

impl<'agent, 'canister: 'agent> Debug for UpdateSettingsBuilder<'agent, 'canister>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'agent, 'canister: 'agent> IntoFuture for UpdateSettingsBuilder<'agent, 'canister>

Source§

type IntoFuture = Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send + 'agent>>

Which kind of future are we turning this into?
Source§

type Output = Result<(), AgentError>

The output that the future will produce on completion.
Source§

fn into_future(self) -> Self::IntoFuture

Creates a future from a value. Read more

Auto Trait Implementations§

§

impl<'agent, 'canister> Freeze for UpdateSettingsBuilder<'agent, 'canister>

§

impl<'agent, 'canister> !RefUnwindSafe for UpdateSettingsBuilder<'agent, 'canister>

§

impl<'agent, 'canister> Send for UpdateSettingsBuilder<'agent, 'canister>

§

impl<'agent, 'canister> Sync for UpdateSettingsBuilder<'agent, 'canister>

§

impl<'agent, 'canister> Unpin for UpdateSettingsBuilder<'agent, 'canister>

§

impl<'agent, 'canister> UnsafeUnpin for UpdateSettingsBuilder<'agent, 'canister>

§

impl<'agent, 'canister> !UnwindSafe for UpdateSettingsBuilder<'agent, 'canister>

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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>,

Source§

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

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more