Skip to main content

Crate ic_wire

Crate ic_wire 

Source
Expand description

Bounded Serde/Postcard contracts with optional schema generation.

Bounded encoding and decoding, method identity and request-header admission. Header admission is neither authentication nor payload/schema/resource validation.

Modules§

serde_packed
Explicit bulk field adapters within the single Serde/Postcard codec.

Structs§

ByteArray
Published Serde bulk byte types; ByteArray includes a length prefix, unlike an ordinary [u8; N]. Changing field representation requires consumer review. Wrapper around [u8; N] to serialize and deserialize efficiently.
ByteBuf
Published Serde bulk byte types; ByteArray includes a length prefix, unlike an ordinary [u8; N]. Changing field representation requires consumer review. Wrapper around Vec<u8> to serialize and deserialize efficiently.
Bytes
Bounded opaque bytes; consumers validate principal bytes using their existing principal type. IC Wire defines no new identity type.
BytesRef
Opaque bytes bounded in length, borrowing their backing storage. Decoding accepts borrowed input only; the value cannot outlive that input.
FiniteF32
Finite IEEE-754 value. Preserves signed zero and subnormal bits.
FiniteF64
Finite IEEE-754 value. Preserves signed zero and subnormal bits.
Limits
Consumer-selected Serde traversal allowances.
List
A sequence with a compile-time element bound.
Packed
Explicit fixed-width little-endian byte buffer. Prefix counts bytes, not elements. Ordinary vectors retain their original Serde representation. N limits the number of words; the default is unbounded apart from codec limits.
Text
UTF-8 text bounded in bytes.
TextRef
UTF-8 text bounded in bytes, borrowing its backing storage. Decoding accepts borrowed input only, without an owned fallback.

Enums§

Direction
Direction carried by the last header byte.
Encoding
Interpretation of the input byte span.
Error
Wire failure categories, independent of transport and application errors.

Traits§

PackedElement
Qualified fixed-width packed words. Sealed; arbitrary-bit casts never admit booleans, nonzero integers or floating-point domain values.

Functions§

decode
Decode exactly one payload or frame under explicit traversal allowances.
encode
Encode into owned storage after a complete sizing/admission pass.
encode_into
Encode into reusable storage, returning only the completed prefix.
encode_to_slice
Encode into caller storage without allocating codec output.
encoded_len
Measure the complete selected encoding without allocating codec output.
method_id
Derive a routing ID from the exact exported method name.
validate_request_header
Admit an exact 11-byte request header before copying its payload.