Function nbt::encode_tag[][src]

pub fn encode_tag<T: Serialize>(o: &T) -> Result<Option<Tag>, NBTError>

Encode a Serde serializable value into a NBT Tag.

Example

use nbt::{encode_tag, Tag};

let list: Vec<i8> = vec![127, 42, 10];
let tag = encode_tag(&list).unwrap().unwrap();