Trait binary_tuples::AddToTuple [] [src]

pub trait AddToTuple<T> where
    Self: Sized
{ fn add(&mut self, input: T); fn with(self, input: T) -> Self { ... } }

An extension trait to simplify working with segments

Required Methods

Add a new segment to a tuple

Provided Methods

A fluent interface for adding a new segment to a tuple

Examples

use binary_tuples::*;

let user_1 = 1;

let tuple = Tuple::new()
    .with("users")
    .with(user_1)
    .into_bytes();

assert_eq!(tuple, vec![2, 117, 115, 101, 114, 115, 0, 21, 1]);

Implementors