Skip to main content

encode_dense

Function encode_dense 

Source
pub fn encode_dense(expr: &Expr) -> Result<BitwiseFrame>
Expand description

Encodes a bare Expr into a dense BitwiseFrame with structural sharing.

Dense mode assigns every subexpression a pre-order number and, on a value-equal subtree already emitted, writes a Ref back-reference tag instead of re-encoding it. It is a deterministic pure function of the value tree and round-trips by Expr::canonical_eq, but it is explicitly opt-in: the plain encode_frame and crate::canonical_bytes stay ref-free so the content-addressing key is unchanged.