Skip to main content

sim_codec_bridge/
lib.rs

1//! BRIDGE packet line codec for SIM.
2//!
3//! This crate provides `codec:bridge`, a strict reversible text face for one
4//! BRIDGE packet per frame. It owns the packet record model, the standard part
5//! and move books, content-addressed packet identity, and the ownership checks
6//! used by model-facing renderers. It does not run packets, invoke tools, or
7//! choose transports.
8
9#![forbid(unsafe_code)]
10#![deny(missing_docs)]
11
12mod call;
13mod canonical;
14mod collab;
15mod frame_book;
16mod frame_render;
17mod identity;
18mod line;
19mod move_book;
20mod ownership;
21mod packet;
22mod part_book;
23mod profile;
24mod render;
25mod shape;
26mod warrant;
27mod weave;
28
29#[cfg(test)]
30mod tests;
31
32pub use call::{BridgeCallArgument, BridgeCallPayload, CallArgumentMedia, validate_call_payload};
33pub use canonical::{BridgeCodec, BridgeCodecLib};
34pub use collab::{
35    BridgeAttestPayload, BridgeEvidencePayload, BridgePatchPayload, BridgeReceiptPayload,
36    BridgeReviewPayload, BridgeScore, BridgeVotePayload, validate_collab_payload,
37};
38pub use frame_book::{
39    BridgeFrameBook, BridgeFramePayload, FrameHoleKind, FrameHoleSpec, FrameKind, FrameSpec,
40    standard_frame_book,
41};
42pub use frame_render::{render_frame, render_frame_with_prose};
43pub use identity::{
44    canonical_packet_datum, content_id_string, packet_content_id, stamp_packet_cid,
45    verify_packet_cid,
46};
47pub use line::{decode_bridge_text, encode_bridge_text};
48pub use move_book::{BridgeMoveBook, BridgeMoveSpec, ReplyRule, standard_move_book};
49pub use ownership::{OwnedSpan, assert_roundtrip, assert_total_ownership};
50pub use packet::{
51    BridgeHeader, BridgePacket, BridgePart, BridgeProvenance, expr_to_packet, packet_to_expr,
52};
53pub use part_book::{
54    AuthorityClass, BridgeBook, BridgePartBook, BridgePartSpec, RenderClass, UnknownPolicy,
55    standard_part_book,
56};
57pub use profile::{
58    BridgeProfileBook, BridgeProfileSpec, ProfilePartCount, ProfilePartRule, ask_profile_spec,
59    ask_profile_symbol, bridge_profile_shape_expr, brief_profile_spec, brief_profile_symbol,
60    collab_profile_spec, collab_profile_symbol, loom_profile_spec, loom_profile_symbol,
61    standard_profile_book,
62};
63pub use render::{render_frame_part, render_frame_part_with_prose};
64pub use shape::bridge_packet_shape_symbol;
65pub use warrant::{
66    BridgeWarrant, BridgeWarrantPolicy, frame_book_content_id, move_book_content_id,
67    part_spec_content_id, warrant_for_packet,
68};
69pub use weave::{
70    BridgeWeavePayload, BridgeWeaveRow, WeavePart, derive_weave_result_shape,
71    validate_weave_payload,
72};
73
74/// Cookbook recipes for this codec, embedded at build time.
75pub static RECIPES: sim_cookbook::EmbeddedDir =
76    include!(concat!(env!("OUT_DIR"), "/cookbook_recipes.rs"));