pub struct InitializationValues {
pub compute_allocation: Option<PossiblyStr<u64>>,
pub memory_allocation: Option<Byte>,
pub freezing_threshold: Option<Duration>,
pub reserved_cycles_limit: Option<u128>,
pub wasm_memory_limit: Option<Byte>,
pub log_visibility: Option<CanisterLogVisibility>,
}Expand description
§Initial Resource Allocations
Fields§
§compute_allocation: Option<PossiblyStr<u64>>§Compute Allocation
Must be a number between 0 and 100, inclusively. It 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.
memory_allocation: Option<Byte>§Memory Allocation
Maximum memory (in bytes) this canister is allowed to occupy. Can be specified as an integer, or as an SI unit string (e.g. “4KB”, “2 MiB”)
freezing_threshold: Option<Duration>§Freezing Threshold
Freezing threshould of the canister, measured in seconds. Valid inputs are numbers (seconds) or strings parsable by humantime (e.g. “15days 2min 2s”).
reserved_cycles_limit: Option<u128>§Reserved Cycles Limit
Specifies the upper limit of the canister’s reserved cycles balance.
Reserved cycles are cycles that the system sets aside for future use by the canister. If a subnet’s storage exceeds 450 GiB, then every time a canister allocates new storage bytes, the system sets aside some amount of cycles from the main balance of the canister. These reserved cycles will be used to cover future payments for the newly allocated bytes. The reserved cycles are not transferable and the amount of reserved cycles depends on how full the subnet is.
A setting of 0 means that the canister will trap if it tries to allocate new storage while the subnet’s memory usage exceeds 450 GiB.
wasm_memory_limit: Option<Byte>§Wasm Memory Limit
Specifies a soft limit (in bytes) on the Wasm memory usage of the canister.
Update calls, timers, heartbeats, installs, and post-upgrades fail if the Wasm memory usage exceeds this limit. The main purpose of this setting is to protect against the case when the canister reaches the hard 4GiB limit.
Must be a number of bytes between 0 and 2^48 (i.e. 256 TiB), inclusive. Can be specified as an integer, or as an SI unit string (e.g. “4KB”, “2 MiB”)
log_visibility: Option<CanisterLogVisibility>§Log Visibility
Specifies who is allowed to read the canister’s logs.
Can be “public”, “controllers” or “allowed_viewers” with a list of principals.
Trait Implementations§
Source§impl Clone for InitializationValues
impl Clone for InitializationValues
Source§fn clone(&self) -> InitializationValues
fn clone(&self) -> InitializationValues
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InitializationValues
impl Debug for InitializationValues
Source§impl Default for InitializationValues
impl Default for InitializationValues
Source§fn default() -> InitializationValues
fn default() -> InitializationValues
Source§impl<'de> Deserialize<'de> for InitializationValueswhere
InitializationValues: Default,
impl<'de> Deserialize<'de> for InitializationValueswhere
InitializationValues: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for InitializationValues
impl JsonSchema for InitializationValues
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for InitializationValues
impl RefUnwindSafe for InitializationValues
impl Send for InitializationValues
impl Sync for InitializationValues
impl Unpin for InitializationValues
impl UnwindSafe for InitializationValues
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more