glossary·2026-03-09·1 min read

Struct

Struct

A struct in Leo is a composite data type with named fields. It is the public counterpart to a record - where records carry an owner and can be encrypted on-chain, structs are purely data containers with no ownership or privacy built in.

leo
struct TokenInfo {
    name: field,
    symbol: field,
    decimals: u8,
    total_supply: u64,
}

Use structs for public state, configuration objects, or any data that doesn't need to be owned or encrypted. Use records when you need private ownership.