pub fn encode<T>(value: &T) -> WriteResult<Vec<u8>>Available on crate feature
alloc only.Expand description
Encodes a value as TXS-encoded XDR data, returning an owned vector.
This function serializes the value and returns a Vec<u8> containing
the serialized data.
Requires feature alloc.
ยงExample
use xdrs::txs;
let value: u32 = 42;
let encoded = txs::encode(&value)?;