Trait tmkms::amino_types::message::AminoMessage[][src]

pub trait AminoMessage: Message {
    fn bytes_vec(&self) -> Vec<u8>
    where
        Self: Sized
, { ... }
fn bytes_vec_length_delimited(&self) -> Vec<u8>
    where
        Self: Sized
, { ... } }

Extend the original prost_amino::Message trait with a few helper functions in order to reduce boiler-plate code (and without modifying the prost-amino dependency).

Provided methods

fn bytes_vec(&self) -> Vec<u8> where
    Self: Sized
[src]

Directly amino encode a prost-amino message into a freshly created Vec. This can be useful when passing those bytes directly to a hasher, or, to reduce boiler plate code when working with the encoded bytes.

Warning: Only use this method, if you are in control what will be encoded. If there is an encoding error, this method will panic.

fn bytes_vec_length_delimited(&self) -> Vec<u8> where
    Self: Sized
[src]

Encode prost-amino message as length delimited.

Warning: Only use this method, if you are in control what will be encoded. If there is an encoding error, this method will panic.

Loading content...

Implementors

impl<M: Message> AminoMessage for M[src]

Loading content...