Skip to main content

Module flags

Module flags 

Source
Expand description

Bitfield flag packing for efficient boolean storage

This module provides utilities to pack multiple boolean flags into a single integer, reducing memory usage and protocol overhead.

§Examples

use synapse_primitives::flags::Flags64;

let mut flags = Flags64::new();
flags.set(0, true);  // require_auth
flags.set(1, true);  // idempotent
flags.set(2, false); // allow_batch

assert!(flags.get(0));
assert!(flags.get(1));
assert!(!flags.get(2));

Structs§

Flags32
32-bit flag container (can hold up to 32 boolean flags)
Flags64
64-bit flag container (can hold up to 64 boolean flags)