Skip to main content

ic_wire/
lib.rs

1//! Bounded Serde/Postcard contracts with optional schema generation.
2//!
3//! Bounded encoding and decoding, method identity and request-header
4//! admission. Header admission is
5//! neither authentication nor payload/schema/resource validation.
6#![no_std]
7extern crate alloc;
8
9mod decode;
10mod encode;
11mod error;
12mod fields;
13mod finite;
14mod framing;
15mod limits;
16mod meter;
17mod packed;
18pub mod serde_packed;
19
20/// Experimental sparse extensions and explicit open variants.
21#[cfg(feature = "evolution")]
22pub mod evolution;
23
24/// Optional schema admission and TypeScript declarations.
25#[cfg(feature = "typescript")]
26pub mod typescript;
27
28pub use decode::decode;
29pub use encode::{encode, encode_into, encode_to_slice, encoded_len};
30pub use error::{Error, LimitKind};
31pub use fields::{Bytes, BytesRef, List, Text, TextRef};
32pub use finite::{FiniteF32, FiniteF64};
33pub use framing::{Direction, Encoding, method_id, validate_request_header};
34#[cfg(feature = "evolution-derive")]
35pub use ic_wire_derive::Wire;
36pub use limits::Limits;
37pub use packed::{Packed, PackedElement};
38
39/// Published Serde bulk byte types; ByteArray includes a length prefix, unlike
40/// an ordinary `[u8; N]`. Changing field representation requires consumer review.
41pub use serde_bytes::{ByteArray, ByteBuf};