pub trait TransactionPreparableFromValueBody: Sized + HasSummary {
const ADDITIONAL_SUMMARY_LENGTH_AS_VALUE: usize = 1usize;
// Required methods
fn prepare_from_value_body(
decoder: &mut TransactionDecoder<'_>,
) -> Result<Self, PrepareError>;
fn value_kind() -> ValueKind<ManifestCustomValueKind>;
}Expand description
Intended for use when the value is encoded without a prefix byte, e.g. when it’s under an array.
Should only decode the value body, NOT read the SBOR value kind.
NOTE:
- The hash should align with the hash from other means. Ideally this means the hash should not include the header byte.
- Ideally the summary should not include costing for reading the value kind byte.
Provided Associated Constants§
Sourceconst ADDITIONAL_SUMMARY_LENGTH_AS_VALUE: usize = 1usize
const ADDITIONAL_SUMMARY_LENGTH_AS_VALUE: usize = 1usize
Most types when read as a value should have a slightly longer length. BUT some types (e.g. transaction payloads) must have the same length regardless, as this length is used for billing the transaction.
Required Methods§
Sourcefn prepare_from_value_body(
decoder: &mut TransactionDecoder<'_>,
) -> Result<Self, PrepareError>
fn prepare_from_value_body( decoder: &mut TransactionDecoder<'_>, ) -> Result<Self, PrepareError>
Prepares the transaction from a transaction decoder by reading the inner body of the tuple/enum (without the value kind)
fn value_kind() -> ValueKind<ManifestCustomValueKind>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.