ic0 1.1.0

Internet Computer System API Binding.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
// This file is generated from ic0.txt.
// Don't manually modify it.
#[cfg(target_family = "wasm")]
#[link(wasm_import_module = "ic0")]
unsafe extern "C" {
    #[doc = "# Safety\n\nAlways safe to call"]
    pub fn msg_arg_data_size() -> usize;
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of bytes with size `size`. The `offset` parameter does not affect safety."]
    pub fn msg_arg_data_copy(dst: usize, offset: usize, size: usize);
    #[doc = "# Safety\n\nAlways safe to call"]
    pub fn msg_caller_size() -> usize;
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of bytes with size `size`. The `offset` parameter does not affect safety."]
    pub fn msg_caller_copy(dst: usize, offset: usize, size: usize);
    #[doc = "# Safety\n\nAlways safe to call"]
    pub fn msg_caller_info_data_size() -> usize;
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of bytes with size `size`. The `offset` parameter does not affect safety."]
    pub fn msg_caller_info_data_copy(dst: usize, offset: usize, size: usize);
    #[doc = "# Safety\n\nAlways safe to call"]
    pub fn msg_caller_info_signer_size() -> usize;
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of bytes with size `size`. The `offset` parameter does not affect safety."]
    pub fn msg_caller_info_signer_copy(dst: usize, offset: usize, size: usize);
    #[doc = "# Safety\n\nAlways safe to call"]
    pub fn msg_reject_code() -> u32;
    #[doc = "# Safety\n\nAlways safe to call"]
    pub fn msg_reject_msg_size() -> usize;
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of bytes with size `size`. The `offset` parameter does not affect safety."]
    pub fn msg_reject_msg_copy(dst: usize, offset: usize, size: usize);
    #[doc = "# Safety\n\nAlways safe to call"]
    pub fn msg_deadline() -> u64;
    #[doc = "# Safety\n\n`src` must be a pointer to a readable sequence of bytes with size `size`."]
    pub fn msg_reply_data_append(src: usize, size: usize);
    #[doc = "# Safety\n\nAlways safe to call"]
    pub fn msg_reply();
    #[doc = "# Safety\n\n`src` must be a pointer to a readable sequence of bytes with size `size`"]
    pub fn msg_reject(src: usize, size: usize);
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of 16 bytes (LE u128)"]
    pub fn msg_cycles_available128(dst: usize);
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of 16 bytes (LE u128)"]
    pub fn msg_cycles_refunded128(dst: usize);
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of 16 bytes (LE u128). The `max_amount_high` and `max_amount_low` parameters do not affect safety."]
    pub fn msg_cycles_accept128(max_amount_high: u64, max_amount_low: u64, dst: usize);
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of 16 bytes (LE u128). The `amount_high` and `amount_low` parameters do not affect safety."]
    pub fn cycles_burn128(amount_high: u64, amount_low: u64, dst: usize);
    #[doc = "# Safety\n\nAlways safe to call"]
    pub fn canister_self_size() -> usize;
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of bytes with size `size`. The `offset` parameter does not affect safety."]
    pub fn canister_self_copy(dst: usize, offset: usize, size: usize);
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of 16 bytes (LE u128)"]
    pub fn canister_cycle_balance128(dst: usize);
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of 16 bytes (LE u128)"]
    pub fn canister_liquid_cycle_balance128(dst: usize);
    #[doc = "# Safety\n\nAlways safe to call"]
    pub fn canister_status() -> u32;
    #[doc = "# Safety\n\nAlways safe to call"]
    pub fn canister_version() -> u64;
    #[doc = "# Safety\n\nAlways safe to call"]
    pub fn subnet_self_size() -> usize;
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of bytes with size `size`. The `offset` parameter does not affect safety."]
    pub fn subnet_self_copy(dst: usize, offset: usize, size: usize);
    #[doc = "# Safety\n\nAlways safe to call"]
    pub fn msg_method_name_size() -> usize;
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of bytes with size `size`. The `offset` parameter does not affect safety."]
    pub fn msg_method_name_copy(dst: usize, offset: usize, size: usize);
    #[doc = "# Safety\n\nAlways safe to call"]
    pub fn accept_message();
    #[doc = "# Safety\n\n- `callee_src` must be a pointer to a readable sequence of bytes with size `callee_size`\n- `name_src` must be a pointer to a readable UTF-8 string with size `name_size`\n- `reply_fun` must be a function pointer with signature (env : usize) -> (), safely callable as an entrypoint with `reply_env`\n- `reject_fun` must be a function pointer with signature (env : usize) -> (), safely callable as an entrypoint with `reject_env`\n- This function takes ownership of `reply_env` and `reject_env`\n- If called, `reply_fun` will take ownership of `reply_env`, `reject_env`, and the `ic0.call_on_cleanup` `env`\n- If called, `reject_fun` will take ownership of `reply_env`, `reject_env`, and the `ic0.call_on_cleanup` `env`"]
    pub fn call_new(
        callee_src: usize,
        callee_size: usize,
        name_src: usize,
        name_size: usize,
        reply_fun: usize,
        reply_env: usize,
        reject_fun: usize,
        reject_env: usize,
    );
    #[doc = "# Safety\n\n- `fun` must be a function pointer with signature (env : usize) -> (), safely callable as an entrypoint with `env`\n- This function takes ownership of `env`\n- If called, `fun` will take ownership of `env`, `reply_env`, and `reject_env`"]
    pub fn call_on_cleanup(fun: usize, env: usize);
    #[doc = "# Safety\n\n`src` must be a pointer to a readable sequence of bytes with size `size`"]
    pub fn call_data_append(src: usize, size: usize);
    #[doc = "# Safety\n\nAlways safe to call"]
    pub fn call_with_best_effort_response(timeout_seconds: u32);
    #[doc = "# Safety\n\nAlways safe to call"]
    pub fn call_cycles_add128(amount_high: u64, amount_low: u64);
    #[doc = "# Safety\n\nAlways safe to call.\n- If this function returns a nonzero value, ownership of `reply_env`, `reject_env`, and the `ic0.call_on_cleanup` `env` is released to the caller\n- If this function returns 0, then (from the perspective of safety, *not* semantics) exactly one of `reply_fun`, `reject_fun`, or the `ic0.call_on_cleanup` `fun` will be called, exactly once."]
    pub fn call_perform() -> u32;
    #[doc = "# Safety\n\nAlways safe to call"]
    pub fn stable64_size() -> u64;
    #[doc = "# Safety\n\nAlways safe to call"]
    pub fn stable64_grow(new_pages: u64) -> u64;
    #[doc = "# Safety\n\n`src` must be a pointer to a readable sequence of bytes with size `size`. The `offset` parameter does not affect safety."]
    pub fn stable64_write(offset: u64, src: u64, size: u64);
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of bytes with size `size`. The `offset` parameter does not affect safety."]
    pub fn stable64_read(dst: u64, offset: u64, size: u64);
    #[doc = "# Safety\n\nAlways safe to call"]
    pub fn root_key_size() -> usize;
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of bytes with size `size`. The `offset` parameter does not affect safety."]
    pub fn root_key_copy(dst: usize, offset: usize, size: usize);
    #[doc = "# Safety\n\n`src` must be a pointer to a readable sequence of bytes with size `size`"]
    pub fn certified_data_set(src: usize, size: usize);
    #[doc = "# Safety\n\nAlways safe to call"]
    pub fn data_certificate_present() -> u32;
    #[doc = "# Safety\n\nAlways safe to call"]
    pub fn data_certificate_size() -> usize;
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of bytes with size `size`. The `offset` parameter does not affect safety."]
    pub fn data_certificate_copy(dst: usize, offset: usize, size: usize);
    #[doc = "# Safety\n\nAlways safe to call"]
    pub fn time() -> u64;
    #[doc = "# Safety\n\nAlways safe to call"]
    pub fn global_timer_set(timestamp: u64) -> u64;
    #[doc = "# Safety\n\nAlways safe to call"]
    pub fn performance_counter(counter_type: u32) -> u64;
    #[doc = "# Safety\n\n`src` must be a pointer to a readable sequence of bytes with size `size`"]
    pub fn is_controller(src: usize, size: usize) -> u32;
    #[doc = "# Safety\n\nAlways safe to call"]
    pub fn in_replicated_execution() -> u32;
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of 16 bytes (LE u128). The `method_name_size` and `payload_size` parameters do not affect safety."]
    pub fn cost_call(method_name_size: u64, payload_size: u64, dst: usize);
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of 16 bytes (LE u128)"]
    pub fn cost_create_canister(dst: usize);
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of 16 bytes (LE u128). The `request_size` and `max_res_bytes` parameters do not affect safety"]
    pub fn cost_http_request(request_size: u64, max_res_bytes: u64, dst: usize);
    #[doc = "# Safety\n\n- `src` must be a pointer to a readable UTF-8 string with size `size`\n- `dst` must be a pointer to a writable sequence of 16 bytes (LE u128)\n- The `ecdsa_curve` parameter does not affect safety"]
    pub fn cost_sign_with_ecdsa(src: usize, size: usize, ecdsa_curve: u32, dst: usize) -> u32;
    #[doc = "# Safety\n\n- `src` must be a pointer to a readable UTF-8 string with size `size`\n- `dst` must be a pointer to a writable sequence of 16 bytes (LE u128)\n- The `algorithm` parameter does not affect safety"]
    pub fn cost_sign_with_schnorr(src: usize, size: usize, algorithm: u32, dst: usize) -> u32;
    #[doc = "# Safety\n\n- `src` must be a pointer to a readable UTF-8 string with size `size`\n- `dst` must be a pointer to a writable sequence of 16 bytes (LE u128)\n- The `vetkd_curve` parameter does not affect safety"]
    pub fn cost_vetkd_derive_key(src: usize, size: usize, vetkd_curve: u32, dst: usize) -> u32;
    #[doc = "# Safety\n\nAlways safe to call"]
    pub fn env_var_count() -> usize;
    #[doc = "# Safety\n\nAlways safe to call"]
    pub fn env_var_name_size(index: usize) -> usize;
    #[doc = "# Safety\n\n- The `index` parameter does not affect safety\n- `dst` must be a pointer to a writable sequence of bytes with size `size`\n- The `offset` parameter does not affect safety"]
    pub fn env_var_name_copy(index: usize, dst: usize, offset: usize, size: usize);
    #[doc = "# Safety\n\n`name_src` must be a pointer to a readable UTF-8 string with size `name_size`"]
    pub fn env_var_name_exists(name_src: usize, name_size: usize) -> u32;
    #[doc = "# Safety\n\n`name_src` must be a pointer to a readable UTF-8 string with size `name_size`"]
    pub fn env_var_value_size(name_src: usize, name_size: usize) -> usize;
    #[doc = "# Safety\n\n- `name_src` must be a pointer to a readable UTF-8 string with size `name_size`\n- `dst` must be a pointer to a writable sequence of bytes with size `size`\n- The `offset` parameter does not affect safety"]
    pub fn env_var_value_copy(
        name_src: usize,
        name_size: usize,
        dst: usize,
        offset: usize,
        size: usize,
    );
    #[doc = "# Safety\n\n`src` must be a pointer to a readable sequence of bytes with size `size`"]
    pub fn debug_print(src: usize, size: usize);
    #[doc = "# Safety\n\n`src` must be a pointer to a readable sequence of bytes with size `size`"]
    pub fn trap(src: usize, size: usize);
}

#[cfg(not(target_family = "wasm"))]
#[allow(unused_variables)]
#[allow(clippy::missing_safety_doc)]
#[allow(clippy::too_many_arguments)]
mod non_wasm {
    #[doc = "# Safety\n\nAlways safe to call"]
    pub unsafe fn msg_arg_data_size() -> usize {
        panic!("msg_arg_data_size should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of bytes with size `size`. The `offset` parameter does not affect safety."]
    pub unsafe fn msg_arg_data_copy(dst: usize, offset: usize, size: usize) {
        panic!("msg_arg_data_copy should only be called inside canisters.");
    }
    #[doc = "# Safety\n\nAlways safe to call"]
    pub unsafe fn msg_caller_size() -> usize {
        panic!("msg_caller_size should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of bytes with size `size`. The `offset` parameter does not affect safety."]
    pub unsafe fn msg_caller_copy(dst: usize, offset: usize, size: usize) {
        panic!("msg_caller_copy should only be called inside canisters.");
    }
    #[doc = "# Safety\n\nAlways safe to call"]
    pub unsafe fn msg_caller_info_data_size() -> usize {
        panic!("msg_caller_info_data_size should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of bytes with size `size`. The `offset` parameter does not affect safety."]
    pub unsafe fn msg_caller_info_data_copy(dst: usize, offset: usize, size: usize) {
        panic!("msg_caller_info_data_copy should only be called inside canisters.");
    }
    #[doc = "# Safety\n\nAlways safe to call"]
    pub unsafe fn msg_caller_info_signer_size() -> usize {
        panic!("msg_caller_info_signer_size should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of bytes with size `size`. The `offset` parameter does not affect safety."]
    pub unsafe fn msg_caller_info_signer_copy(dst: usize, offset: usize, size: usize) {
        panic!("msg_caller_info_signer_copy should only be called inside canisters.");
    }
    #[doc = "# Safety\n\nAlways safe to call"]
    pub unsafe fn msg_reject_code() -> u32 {
        panic!("msg_reject_code should only be called inside canisters.");
    }
    #[doc = "# Safety\n\nAlways safe to call"]
    pub unsafe fn msg_reject_msg_size() -> usize {
        panic!("msg_reject_msg_size should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of bytes with size `size`. The `offset` parameter does not affect safety."]
    pub unsafe fn msg_reject_msg_copy(dst: usize, offset: usize, size: usize) {
        panic!("msg_reject_msg_copy should only be called inside canisters.");
    }
    #[doc = "# Safety\n\nAlways safe to call"]
    pub unsafe fn msg_deadline() -> u64 {
        panic!("msg_deadline should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`src` must be a pointer to a readable sequence of bytes with size `size`."]
    pub unsafe fn msg_reply_data_append(src: usize, size: usize) {
        panic!("msg_reply_data_append should only be called inside canisters.");
    }
    #[doc = "# Safety\n\nAlways safe to call"]
    pub unsafe fn msg_reply() {
        panic!("msg_reply should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`src` must be a pointer to a readable sequence of bytes with size `size`"]
    pub unsafe fn msg_reject(src: usize, size: usize) {
        panic!("msg_reject should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of 16 bytes (LE u128)"]
    pub unsafe fn msg_cycles_available128(dst: usize) {
        panic!("msg_cycles_available128 should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of 16 bytes (LE u128)"]
    pub unsafe fn msg_cycles_refunded128(dst: usize) {
        panic!("msg_cycles_refunded128 should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of 16 bytes (LE u128). The `max_amount_high` and `max_amount_low` parameters do not affect safety."]
    pub unsafe fn msg_cycles_accept128(max_amount_high: u64, max_amount_low: u64, dst: usize) {
        panic!("msg_cycles_accept128 should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of 16 bytes (LE u128). The `amount_high` and `amount_low` parameters do not affect safety."]
    pub unsafe fn cycles_burn128(amount_high: u64, amount_low: u64, dst: usize) {
        panic!("cycles_burn128 should only be called inside canisters.");
    }
    #[doc = "# Safety\n\nAlways safe to call"]
    pub unsafe fn canister_self_size() -> usize {
        panic!("canister_self_size should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of bytes with size `size`. The `offset` parameter does not affect safety."]
    pub unsafe fn canister_self_copy(dst: usize, offset: usize, size: usize) {
        panic!("canister_self_copy should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of 16 bytes (LE u128)"]
    pub unsafe fn canister_cycle_balance128(dst: usize) {
        panic!("canister_cycle_balance128 should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of 16 bytes (LE u128)"]
    pub unsafe fn canister_liquid_cycle_balance128(dst: usize) {
        panic!("canister_liquid_cycle_balance128 should only be called inside canisters.");
    }
    #[doc = "# Safety\n\nAlways safe to call"]
    pub unsafe fn canister_status() -> u32 {
        panic!("canister_status should only be called inside canisters.");
    }
    #[doc = "# Safety\n\nAlways safe to call"]
    pub unsafe fn canister_version() -> u64 {
        panic!("canister_version should only be called inside canisters.");
    }
    #[doc = "# Safety\n\nAlways safe to call"]
    pub unsafe fn subnet_self_size() -> usize {
        panic!("subnet_self_size should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of bytes with size `size`. The `offset` parameter does not affect safety."]
    pub unsafe fn subnet_self_copy(dst: usize, offset: usize, size: usize) {
        panic!("subnet_self_copy should only be called inside canisters.");
    }
    #[doc = "# Safety\n\nAlways safe to call"]
    pub unsafe fn msg_method_name_size() -> usize {
        panic!("msg_method_name_size should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of bytes with size `size`. The `offset` parameter does not affect safety."]
    pub unsafe fn msg_method_name_copy(dst: usize, offset: usize, size: usize) {
        panic!("msg_method_name_copy should only be called inside canisters.");
    }
    #[doc = "# Safety\n\nAlways safe to call"]
    pub unsafe fn accept_message() {
        panic!("accept_message should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n- `callee_src` must be a pointer to a readable sequence of bytes with size `callee_size`\n- `name_src` must be a pointer to a readable UTF-8 string with size `name_size`\n- `reply_fun` must be a function pointer with signature (env : usize) -> (), safely callable as an entrypoint with `reply_env`\n- `reject_fun` must be a function pointer with signature (env : usize) -> (), safely callable as an entrypoint with `reject_env`\n- This function takes ownership of `reply_env` and `reject_env`\n- If called, `reply_fun` will take ownership of `reply_env`, `reject_env`, and the `ic0.call_on_cleanup` `env`\n- If called, `reject_fun` will take ownership of `reply_env`, `reject_env`, and the `ic0.call_on_cleanup` `env`"]
    pub unsafe fn call_new(
        callee_src: usize,
        callee_size: usize,
        name_src: usize,
        name_size: usize,
        reply_fun: usize,
        reply_env: usize,
        reject_fun: usize,
        reject_env: usize,
    ) {
        panic!("call_new should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n- `fun` must be a function pointer with signature (env : usize) -> (), safely callable as an entrypoint with `env`\n- This function takes ownership of `env`\n- If called, `fun` will take ownership of `env`, `reply_env`, and `reject_env`"]
    pub unsafe fn call_on_cleanup(fun: usize, env: usize) {
        panic!("call_on_cleanup should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`src` must be a pointer to a readable sequence of bytes with size `size`"]
    pub unsafe fn call_data_append(src: usize, size: usize) {
        panic!("call_data_append should only be called inside canisters.");
    }
    #[doc = "# Safety\n\nAlways safe to call"]
    pub unsafe fn call_with_best_effort_response(timeout_seconds: u32) {
        panic!("call_with_best_effort_response should only be called inside canisters.");
    }
    #[doc = "# Safety\n\nAlways safe to call"]
    pub unsafe fn call_cycles_add128(amount_high: u64, amount_low: u64) {
        panic!("call_cycles_add128 should only be called inside canisters.");
    }
    #[doc = "# Safety\n\nAlways safe to call.\n- If this function returns a nonzero value, ownership of `reply_env`, `reject_env`, and the `ic0.call_on_cleanup` `env` is released to the caller\n- If this function returns 0, then (from the perspective of safety, *not* semantics) exactly one of `reply_fun`, `reject_fun`, or the `ic0.call_on_cleanup` `fun` will be called, exactly once."]
    pub unsafe fn call_perform() -> u32 {
        panic!("call_perform should only be called inside canisters.");
    }
    #[doc = "# Safety\n\nAlways safe to call"]
    pub unsafe fn stable64_size() -> u64 {
        panic!("stable64_size should only be called inside canisters.");
    }
    #[doc = "# Safety\n\nAlways safe to call"]
    pub unsafe fn stable64_grow(new_pages: u64) -> u64 {
        panic!("stable64_grow should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`src` must be a pointer to a readable sequence of bytes with size `size`. The `offset` parameter does not affect safety."]
    pub unsafe fn stable64_write(offset: u64, src: u64, size: u64) {
        panic!("stable64_write should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of bytes with size `size`. The `offset` parameter does not affect safety."]
    pub unsafe fn stable64_read(dst: u64, offset: u64, size: u64) {
        panic!("stable64_read should only be called inside canisters.");
    }
    #[doc = "# Safety\n\nAlways safe to call"]
    pub unsafe fn root_key_size() -> usize {
        panic!("root_key_size should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of bytes with size `size`. The `offset` parameter does not affect safety."]
    pub unsafe fn root_key_copy(dst: usize, offset: usize, size: usize) {
        panic!("root_key_copy should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`src` must be a pointer to a readable sequence of bytes with size `size`"]
    pub unsafe fn certified_data_set(src: usize, size: usize) {
        panic!("certified_data_set should only be called inside canisters.");
    }
    #[doc = "# Safety\n\nAlways safe to call"]
    pub unsafe fn data_certificate_present() -> u32 {
        panic!("data_certificate_present should only be called inside canisters.");
    }
    #[doc = "# Safety\n\nAlways safe to call"]
    pub unsafe fn data_certificate_size() -> usize {
        panic!("data_certificate_size should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of bytes with size `size`. The `offset` parameter does not affect safety."]
    pub unsafe fn data_certificate_copy(dst: usize, offset: usize, size: usize) {
        panic!("data_certificate_copy should only be called inside canisters.");
    }
    #[doc = "# Safety\n\nAlways safe to call"]
    pub unsafe fn time() -> u64 {
        panic!("time should only be called inside canisters.");
    }
    #[doc = "# Safety\n\nAlways safe to call"]
    pub unsafe fn global_timer_set(timestamp: u64) -> u64 {
        panic!("global_timer_set should only be called inside canisters.");
    }
    #[doc = "# Safety\n\nAlways safe to call"]
    pub unsafe fn performance_counter(counter_type: u32) -> u64 {
        panic!("performance_counter should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`src` must be a pointer to a readable sequence of bytes with size `size`"]
    pub unsafe fn is_controller(src: usize, size: usize) -> u32 {
        panic!("is_controller should only be called inside canisters.");
    }
    #[doc = "# Safety\n\nAlways safe to call"]
    pub unsafe fn in_replicated_execution() -> u32 {
        panic!("in_replicated_execution should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of 16 bytes (LE u128). The `method_name_size` and `payload_size` parameters do not affect safety."]
    pub unsafe fn cost_call(method_name_size: u64, payload_size: u64, dst: usize) {
        panic!("cost_call should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of 16 bytes (LE u128)"]
    pub unsafe fn cost_create_canister(dst: usize) {
        panic!("cost_create_canister should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`dst` must be a pointer to a writable sequence of 16 bytes (LE u128). The `request_size` and `max_res_bytes` parameters do not affect safety"]
    pub unsafe fn cost_http_request(request_size: u64, max_res_bytes: u64, dst: usize) {
        panic!("cost_http_request should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n- `src` must be a pointer to a readable UTF-8 string with size `size`\n- `dst` must be a pointer to a writable sequence of 16 bytes (LE u128)\n- The `ecdsa_curve` parameter does not affect safety"]
    pub unsafe fn cost_sign_with_ecdsa(
        src: usize,
        size: usize,
        ecdsa_curve: u32,
        dst: usize,
    ) -> u32 {
        panic!("cost_sign_with_ecdsa should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n- `src` must be a pointer to a readable UTF-8 string with size `size`\n- `dst` must be a pointer to a writable sequence of 16 bytes (LE u128)\n- The `algorithm` parameter does not affect safety"]
    pub unsafe fn cost_sign_with_schnorr(
        src: usize,
        size: usize,
        algorithm: u32,
        dst: usize,
    ) -> u32 {
        panic!("cost_sign_with_schnorr should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n- `src` must be a pointer to a readable UTF-8 string with size `size`\n- `dst` must be a pointer to a writable sequence of 16 bytes (LE u128)\n- The `vetkd_curve` parameter does not affect safety"]
    pub unsafe fn cost_vetkd_derive_key(
        src: usize,
        size: usize,
        vetkd_curve: u32,
        dst: usize,
    ) -> u32 {
        panic!("cost_vetkd_derive_key should only be called inside canisters.");
    }
    #[doc = "# Safety\n\nAlways safe to call"]
    pub unsafe fn env_var_count() -> usize {
        panic!("env_var_count should only be called inside canisters.");
    }
    #[doc = "# Safety\n\nAlways safe to call"]
    pub unsafe fn env_var_name_size(index: usize) -> usize {
        panic!("env_var_name_size should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n- The `index` parameter does not affect safety\n- `dst` must be a pointer to a writable sequence of bytes with size `size`\n- The `offset` parameter does not affect safety"]
    pub unsafe fn env_var_name_copy(index: usize, dst: usize, offset: usize, size: usize) {
        panic!("env_var_name_copy should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`name_src` must be a pointer to a readable UTF-8 string with size `name_size`"]
    pub unsafe fn env_var_name_exists(name_src: usize, name_size: usize) -> u32 {
        panic!("env_var_name_exists should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`name_src` must be a pointer to a readable UTF-8 string with size `name_size`"]
    pub unsafe fn env_var_value_size(name_src: usize, name_size: usize) -> usize {
        panic!("env_var_value_size should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n- `name_src` must be a pointer to a readable UTF-8 string with size `name_size`\n- `dst` must be a pointer to a writable sequence of bytes with size `size`\n- The `offset` parameter does not affect safety"]
    pub unsafe fn env_var_value_copy(
        name_src: usize,
        name_size: usize,
        dst: usize,
        offset: usize,
        size: usize,
    ) {
        panic!("env_var_value_copy should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`src` must be a pointer to a readable sequence of bytes with size `size`"]
    pub unsafe fn debug_print(src: usize, size: usize) {
        panic!("debug_print should only be called inside canisters.");
    }
    #[doc = "# Safety\n\n`src` must be a pointer to a readable sequence of bytes with size `size`"]
    pub unsafe fn trap(src: usize, size: usize) {
        panic!("trap should only be called inside canisters.");
    }
}

#[cfg(not(target_family = "wasm"))]
pub use non_wasm::*;