pub struct CanisterSettings {
pub controllers: Option<Vec<Principal>>,
pub compute_allocation: Option<Nat>,
pub memory_allocation: Option<Nat>,
pub freezing_threshold: Option<Nat>,
pub reserved_cycles_limit: Option<Nat>,
pub log_visibility: Option<LogVisibility>,
pub log_memory_limit: Option<Nat>,
pub snapshot_visibility: Option<SnapshotVisibility>,
pub wasm_memory_limit: Option<Nat>,
pub wasm_memory_threshold: Option<Nat>,
pub environment_variables: Option<Vec<EnvironmentVariable>>,
}Expand description
§Canister Settings
For arguments of create_canister,
update_settings and
provisional_create_canister_with_cycles.
All fields are Option types, allowing selective settings/updates.
Fields§
§controllers: Option<Vec<Principal>>A list of at most 10 principals.
The principals in this list become the controllers of the canister.
Default value: A list containing only the caller of the create_canister call.
compute_allocation: Option<Nat>Indicates how much compute power should be guaranteed to this canister, expressed as a percentage of the maximum compute power that a single canister can allocate.
If the IC cannot provide the requested allocation, for example because it is oversubscribed, the call will be rejected.
Must be a number between 0 and 100, inclusively.
Default value: 0
memory_allocation: Option<Nat>Indicates how much memory (bytes) the canister is allowed to use in total.
If the IC cannot provide the requested allocation, for example because it is oversubscribed, the call will be rejected.
If set to 0, then memory growth of the canister will be best-effort and subject to the available memory on the IC.
Must be a number between 0 and 248 (i.e 256TB), inclusively.
Default value: 0
freezing_threshold: Option<Nat>Indicates a length of time in seconds.
A canister is considered frozen whenever the IC estimates that the canister would be depleted of cycles
before freezing_threshold seconds pass, given the canister’s current size and the IC’s current cost for storage.
Must be a number between 0 and 264-1, inclusively.
Default value: 2_592_000 (approximately 30 days).
reserved_cycles_limit: Option<Nat>Indicates the upper limit on CanisterStatusResult::reserved_cycles of the canister.
Must be a number between 0 and 2128-1, inclusively.
Default value: 5_000_000_000_000 (5 trillion cycles).
log_visibility: Option<LogVisibility>Defines who is allowed to read the canister’s logs.
Default value: LogVisibility::Controllers.
log_memory_limit: Option<Nat>Indicates the upper limit on the memory used for canister logs (bytes).
Default value: 4096.
snapshot_visibility: Option<SnapshotVisibility>Defines who is allowed to read the canister’s snapshots.
Default value: SnapshotVisibility::Controllers.
wasm_memory_limit: Option<Nat>Indicates the upper limit on the WASM heap memory (bytes) consumption of the canister.
Must be a number between 0 and 248-1 (i.e 256TB), inclusively.
Default value: 3_221_225_472 (3 GiB).
wasm_memory_threshold: Option<Nat>Indicates the threshold on the remaining wasm memory size of the canister in bytes.
If the remaining wasm memory size of the canister is below the threshold, execution of the “on low wasm memory” hook is scheduled.
Must be a number between 0 and 264-1, inclusively.
Default value: 0 (i.e., the “on low wasm memory” hook is never scheduled).
environment_variables: Option<Vec<EnvironmentVariable>>A list of environment variables.
These variables are accessible to the canister during execution and can be used to configure canister behavior without code changes. Each key must be unique.
Default value: null (i.e., no environment variables provided).
Trait Implementations§
Source§impl CandidType for CanisterSettings
impl CandidType for CanisterSettings
Source§impl Clone for CanisterSettings
impl Clone for CanisterSettings
Source§fn clone(&self) -> CanisterSettings
fn clone(&self) -> CanisterSettings
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CanisterSettings
impl Debug for CanisterSettings
Source§impl Default for CanisterSettings
impl Default for CanisterSettings
Source§fn default() -> CanisterSettings
fn default() -> CanisterSettings
Source§impl<'de> Deserialize<'de> for CanisterSettings
impl<'de> Deserialize<'de> for CanisterSettings
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CanisterSettings, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CanisterSettings, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for CanisterSettings
Source§impl Hash for CanisterSettings
impl Hash for CanisterSettings
Source§impl Ord for CanisterSettings
impl Ord for CanisterSettings
Source§fn cmp(&self, other: &CanisterSettings) -> Ordering
fn cmp(&self, other: &CanisterSettings) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for CanisterSettings
impl PartialEq for CanisterSettings
Source§impl PartialOrd for CanisterSettings
impl PartialOrd for CanisterSettings
Source§impl Serialize for CanisterSettings
impl Serialize for CanisterSettings
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for CanisterSettings
Auto Trait Implementations§
impl Freeze for CanisterSettings
impl RefUnwindSafe for CanisterSettings
impl Send for CanisterSettings
impl Sync for CanisterSettings
impl Unpin for CanisterSettings
impl UnsafeUnpin for CanisterSettings
impl UnwindSafe for CanisterSettings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.