Skip to main content

Rust SDK API Reference / Record V2 codecs and verification / RecordV2Fields::parse_content

Method: RecordV2Fields::parse_content()

pub fn parse_content(self, record: Record) -> Result<ParsedRecordV2<'a>, SnsError>

Defined in: record_v2.rs:107

Decodes the borrowed content bytes according to record and returns a ParsedRecordV2 retaining the header and proof fields.

Parameters

record: record type used to decode the content bytes.

Returns

ParsedRecordV2, or the relevant content decoding SnsError.

Example

use sns_sdk::record::{record_v2::decode_record_v2_fields, Record};

let parsed = decode_record_v2_fields(&account.data)?.parse_content(Record::Url)?;