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
//! Typed IC entrypoints, available only with the `endpoint` feature.
//!
//! Bare `query` and `update` derive an identity from the exported method name and
//! use [`DEFAULT_REQUEST_LIMITS`] / [`DEFAULT_RESPONSE_LIMITS`]. Optional `id`,
//! `request` and `response` constant expressions override those choices.
//! A handler takes zero arguments (a framed unit request) or one owned Serde value.
//! Synchronous handlers can select `borrow` with one request: borrowed fields and
//! replies refer to Platform's argument vector, retained through reply encoding.
//! This avoids a second field copy; the initial ingress copy is still required.
//! Async handlers remain owned. Framing, budgets and validation are unchanged.
//! `query(composite, ...)` selects a composite query. Async handlers use Platform's
//! protected executor. `name = "..."` overrides the export name; `crate = "path"`
//! selects a renamed/re-exported Wire crate.
//!
//! Optional `contract = NAME` exposes a typed [`Contract`] constant taken from the
//! exact signature and settings. Its native schema methods delegate to existing
//! Wire projection; no automatic registry, custom Wasm metadata section or
//! artifact admission is installed.
//!
//! Encoding failures trap, rolling back a synchronous update's mutations.
//! Async updates follow ordinary IC transactions: state committed before an
//! inter-canister await cannot be rolled back by a later reply-encoding trap.
//! Only the current callback's changes roll back. Query state is not persisted.
//!
//! Frameworks may instead pass the helpers below to Platform's codec hooks around
//! their existing guarded handlers. Admission must run as a Platform `guard`
//! before its argument copy. Framework access refusals, dispatch, registration and
//! final artifact checks remain framework-owned; do not stack two export macros.
use crate::;
use ;
use ;
pub use ;
/// Default full-frame request limits for the optional endpoint integration.
///
/// 64 KiB of frame bytes, 8 MiB conservative traversal allowance, 65,536 charged
/// value visits and depth 32. The allocation allowance excludes the ingress copy;
/// it is not a measured heap cap. Field bounds and application validation still
/// apply. These are endpoint policy, not implicit limits in the core codec.
pub const DEFAULT_REQUEST_LIMITS: Limits = Limits ;
/// Default full-frame response limits, with the same values as the request defaults.
/// Request and response overrides remain independent; reply failure still traps.
pub const DEFAULT_RESPONSE_LIMITS: Limits = DEFAULT_REQUEST_LIMITS;
/// A handler's types and explicit frame settings, without a registry or transport.
///
/// Prefer the attribute's `contract = NAME` output to a separately maintained
/// declaration. Native schemas do not prove target-specific type-layout parity;
/// the consumer still owns final artifact admission.
/// Platform paths used by generated entrypoints, including renamed Wire imports.
/// Trap on an oversized ingress before Platform allocates/copies argument bytes.
/// Decode a complete native request frame, trapping on typed codec failure.
///
/// Call [`admit_request`] before obtaining the argument buffer. This function
/// preserves native identity, traversal, primitive and complete-input validation.
/// Borrowed fields refer to `bytes`; the caller must retain it through their use.
/// Encode the native response frame within its allowances, trapping on failure.
///
/// A trap (rather than a rejection or error reply) preserves synchronous mutation
/// rollback. Earlier async transactions remain committed; see the module docs.
Sized>