Function tycho::encode[][src]

pub fn encode(element: Element) -> Vec<u8>

Encode an element into bytes.

use tycho::{Element, ValueUtil, encode};

let element = Element::string("Hello World");
let bytes = encode(element);

assert_eq!(bytes, vec![29, 11, 72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100])

This function does not create an error.