encode

Function encode 

Source
pub fn encode(encoding: Encoding<'_>) -> Result<Vec<u8>, ValError>
Expand description

Encode value to parameter encoding. For encoding constant value or encoding address to variable directly. Use Command::allocate to encode variable without specifying pointer directly

ยงExample

Encode local constant as LC1 bytecode with value of 42

let byte: Vec<u8> = encode(LC1(42)).unwrap();
println("Bytecode: {:02X?}", byte);