Skip to main content

ic_wire/
lib.rs

1//! Bounded Serde/Postcard contracts with optional host 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/// Optional host-only schema admission and TypeScript declarations.
21#[cfg(all(feature = "typescript", not(target_family = "wasm")))]
22pub mod typescript;
23
24pub use decode::decode;
25pub use encode::{encode, encode_into, encode_to_slice, encoded_len};
26pub use error::Error;
27pub use fields::{Bytes, BytesRef, List, Text, TextRef};
28pub use finite::{FiniteF32, FiniteF64};
29pub use framing::{Direction, Encoding, method_id, validate_request_header};
30pub use limits::Limits;
31pub use packed::{Packed, PackedElement};
32
33/// Published Serde bulk byte types; ByteArray includes a length prefix, unlike
34/// an ordinary `[u8; N]`. Changing field representation requires consumer review.
35pub use serde_bytes::{ByteArray, ByteBuf};