Rust SDK API Reference / Record V1 codecs / deserialize_record
Function: deserialize_record()
pub fn deserialize_record(data: &[u8], record: Record, record_key: &Pubkey) -> Result<String, SnsError>
Defined in: record_v1.rs:50
Decodes textual records or validates fixed-width legacy data. SOL payloads verify their signature against record_key.
Parameters
data is account payload bytes, record selects the codec, and record_key identifies the SOL record for signature verification.
Returns
The decoded string. Malformed fixed-width data returns SnsError::InvalidRecordData; codec failures propagate as SnsError.
Example
use sns_sdk::record::{record_v1::deserialize_record, Record};
let value = deserialize_record(b"https://example.com", Record::Url, &record_key)?;