encode_as_type

Function encode_as_type 

Source
pub fn encode_as_type<R: TypeResolver, T>(
    value: &Value<T>,
    ty_id: R::TypeId,
    types: &R,
    buf: &mut Vec<u8>,
) -> Result<(), EncodeError>
Expand description

Attempt to encode some crate::Value<T> into SCALE bytes, by providing a pointer to the type ID that we’d like to encode it as, a type registry from which we’ll look up the relevant type information, and a buffer to encode the bytes to.