Expand description
Optional typed IC entrypoints using Platform’s export generator and executor. Explicit resource admission for native Serde payloads in the same Postcard format.
Types, IDs, deterministic serialization and domain rules are consumer-owned. Resource admission follows Serde visits; no static schema is inferred. Custom Serde implementations are trusted: allocations/work outside visited values cannot be constrained here. See the runtime guide for budget semantics.
Constants§
- REQUEST_
HEADER_ BYTES - Native request frame header size, including magic, identity and direction.
Functions§
- decode
- Decode a complete Postcard payload; allocation admission precedes visitor calls. Borrowed bytes and strings may refer directly to the input for its lifetime. Primitive representations are checked while reading; Serde normalization is consumer-owned.
- decode_
request - Check request identity and direction before decoding its bounded native value.
- decode_
response - Check response identity and direction before decoding its bounded native value.
- encode
- Encode an owned or borrowed native payload under explicit traversal allowances.
- encode_
into - Encode into reusable caller storage. Previous contents are cleared, including on error. Capacity may be lost on serialization failure; successful calls retain it. Retain a separate immutable frame when bytes must survive subsequent calls for retries.
- encode_
request - Encode a complete request;
limits.bytesincludes the canonical frame header. - encode_
request_ into - Encode a request into reusable storage; follows
encode_intofailure semantics. - encode_
request_ to_ slice - Encode a complete request into caller storage; follows
encode_to_slice. - encode_
response - Encode a complete response, including borrowed response projections.
- encode_
response_ into - Encode a response into reusable storage; follows
encode_intofailure semantics. - encode_
response_ to_ slice - Encode a complete response into caller storage; follows
encode_to_slice. - encode_
to_ slice - Encode a payload into caller-owned storage without allocating codec output.
- encoded_
frame_ len - Measure a request or response frame; both directions have equal header length.
- encoded_
len - Measure one native payload with no output allocation;
bytesexcludes a frame. - method_
id - Stable automatic endpoint identity from the exact exported IC method name.
- validate_
request_ header - Validate only the fixed request header before a transport copies the payload. The complete request still requires normal decoding and resource admission. This delegates to the same validator previously used inside Wire’s endpoint module: accepted bytes and error ordering are unchanged after its package move.
- with_
encoded - Encode a payload using scratch storage or owned fallback, then consume its bytes.