pub enum TypeDescriptor {
Show 30 variants
Boolean,
Field,
JubjubScalar,
Secp256k1Base,
Secp256k1Scalar,
Secp256r1Base,
Secp256r1Scalar,
Curve25519Base,
Curve25519Scalar,
JubjubPoint,
Secp256k1Point,
Secp256r1Point,
Curve25519Point,
Unknown,
Uint {
maxval: IntLit,
alignment_bytes: Option<u32>,
},
Bytes {
length: u32,
},
Opaque {
ts_type: String,
},
Vector {
length: u32,
elt_type: Box<TypeDescriptor>,
},
Tuple {
types: Vec<TypeDescriptor>,
},
Struct {
name: String,
elements: Vec<StructField>,
},
Enum {
name: String,
elements: Vec<String>,
},
Alias {
name: String,
of: Box<TypeDescriptor>,
},
Contract {
name: String,
circuits: Vec<ContractCircuitSig>,
},
Cell {
of: Box<TypeDescriptor>,
},
Counter,
Map {
key: Box<TypeDescriptor>,
value: Box<TypeDescriptor>,
},
Set {
of: Box<TypeDescriptor>,
},
List {
of: Box<TypeDescriptor>,
},
MerkleTree {
depth: IntLit,
of: Box<TypeDescriptor>,
},
HistoricMerkleTree {
depth: IntLit,
of: Box<TypeDescriptor>,
},
}Variants§
Boolean
Field
JubjubScalar
Scalar field of the Jubjub curve. Shares Field’s single-atom
alignment and encoding; only the valid range differs
(JUBJUB_SCALAR_MODULUS - 1). compactc 0.33 promoted this from
an opaque builtin to a standard-library type.
Secp256k1Base
Base field of secp256k1. Two atoms — bytes:24 holding the low
192 bits, bytes:8 the high 64 — with the value rotated by one
(0 maps to the modulus-1, everything else to v - 1) because
that is what the ZKIR representation stores.
Secp256k1Scalar
Scalar field of secp256k1. Same two-atom layout and rotation as
TypeDescriptor::Secp256k1Base, different modulus.
Secp256r1Base
Base field of secp256r1 (P-256). Same two-atom layout and
rotation as TypeDescriptor::Secp256k1Base.
Secp256r1Scalar
Scalar field of secp256r1. Same layout as
TypeDescriptor::Secp256k1Base.
Curve25519Base
Base field of Curve25519. Same layout as
TypeDescriptor::Secp256k1Base.
Curve25519Scalar
Scalar field of Curve25519. Two atoms split at bit 204 rather
than 192 — bytes:26 then bytes:7 — with the same rotation.
JubjubPoint
Point on the Jubjub curve: two native field atoms, x then y.
Secp256k1Point
Point on secp256k1: x and y each as a Secp256k1Base pair,
then a native field atom holding the identity flag.
Secp256r1Point
Point on secp256r1, laid out as TypeDescriptor::Secp256k1Point
over Secp256r1Base.
Curve25519Point
Point on Curve25519 in Edwards form: x then y, each a
Curve25519Base pair. No identity flag; the identity is (0, 1).
Unknown
Element type of an empty vector literal ([]). The compact
fork emits {"type-name": "Unknown"} here, mirroring the
TypeScript emitter’s format-type. Never reaches the
descriptors map — only appears inline in circuit bodies.
Uint
Bytes
Opaque
Vector
Tuple
Fields
types: Vec<TypeDescriptor>Struct
Enum
Alias
Contract
Cell
Fields
of: Box<TypeDescriptor>Counter
Map
Set
Fields
of: Box<TypeDescriptor>List
Fields
of: Box<TypeDescriptor>MerkleTree
HistoricMerkleTree
Implementations§
Source§impl TypeDescriptor
impl TypeDescriptor
Sourcepub fn contract_address() -> Self
pub fn contract_address() -> Self
The standard library’s ContractAddress struct. A value of a
contract type is the address of a contract implementing it, and
compactc stores and passes it as this struct (subst-tcontract
in print-typescript.ss).
Trait Implementations§
Source§impl Clone for TypeDescriptor
impl Clone for TypeDescriptor
Source§impl Debug for TypeDescriptor
impl Debug for TypeDescriptor
Source§impl<'de> Deserialize<'de> for TypeDescriptor
impl<'de> Deserialize<'de> for TypeDescriptor
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for TypeDescriptor
A type as a person reads it, in Compact’s spelling: Uint<0..255>,
Bytes<32>, Map<Field, Boolean>, Struct<Point>.
impl Display for TypeDescriptor
A type as a person reads it, in Compact’s spelling: Uint<0..255>,
Bytes<32>, Map<Field, Boolean>, Struct<Point>.