Skip to main content

Rust SDK API Reference / Record V1 codecs / get_record_size

Function: get_record_size()

pub fn get_record_size(record: Record) -> Option<usize>

Defined in: record_v1.rs:40

Returns fixed widths for SOL (96), EVM/Injective (20), IPv4 (4), and IPv6 (16). Other record types are variable-width.

Parameters

record: the Record variant to inspect.

Returns

Some(usize) for fixed binary encodings, otherwise None.

Example

use sns_sdk::record::{record_v1::get_record_size, Record};

assert_eq!(get_record_size(Record::A), Some(4));