Expand description
Schema-shaped records with manually implemented domain construction.
Decode fields first, then explicitly choose the construction capability. For example, building a block header does not authenticate it against its parent:
use miden_objects::{BuildUnchecked, DecodeMessage, proto};
use miden_protocol::block::BlockHeader;
let decoded = message.decode_fields()?;
let header = decoded.build_unchecked()?;Generated records deliberately do not provide direct protobuf-to-domain conversions, even when construction is checked or infallible. This keeps the trust decision explicit.
ⓘ
use miden_objects::proto;
use miden_protocol::block::BlockHeader;
let _: BlockHeader = proto::blockchain::BlockHeader::default().try_into().unwrap();Borrowing a message must not bypass that decision either:
ⓘ
use miden_objects::proto;
use miden_protocol::block::BlockHeader;
let message = proto::blockchain::BlockHeader::default();
let _: BlockHeader = (&message).try_into().unwrap();ⓘ
use miden_objects::proto;
use miden_protocol::account::AccountId;
let _: AccountId = proto::account::AccountId::default().try_into().unwrap();ⓘ
use miden_objects::proto;
use miden_protocol::block::BlockNumber;
let _: BlockNumber = proto::blockchain::BlockNumber::default().into();A parsed MAST forest is not trusted until its structure and node hashes are verified:
ⓘ
use miden_objects::proto;
use miden_protocol::MastForest;
let _: MastForest = proto::primitives::MastForest::default().try_into().unwrap();ⓘ
use miden_objects::proto;
use miden_protocol::MastForest;
let message = proto::primitives::MastForest::default();
let _: MastForest = (&message).try_into().unwrap();Modules§
- account
- Domain construction for decoded account messages.
- asset
- Domain construction for decoded asset messages.
- blockchain
- Domain construction for decoded blockchain messages.
- note
- Domain construction for decoded note messages.
- primitives
- Domain construction for decoded primitives messages.
- protocol_
config - Domain construction for decoded protocol_config messages.
- transaction
- Domain construction for decoded transaction messages.
Structs§
- Verification
Error - A verification failure from a composite object, preserving its concrete domain source.