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
fn add(&mut self, input: T)
Add a new segment to a tuple
Provided Methods
fn with(self, input: T) -> Self
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
impl AddToTuple<i64> for Tuple
impl AddToTuple<String> for Tuple
impl<'a> AddToTuple<&'a [u8]> for Tuple
impl<'a> AddToTuple<&'a Vec<u8>> for Tuple
impl AddToTuple<f32> for Tuple
impl AddToTuple<f64> for Tuple
impl AddToTuple<Vec<u8>> for Tuple
impl AddToTuple<&'static str> for Tuple
impl AddToTuple<Uuid> for Tuple
impl AddToTuple<Vec<Segment>> for Tuple
impl<'a> AddToTuple<&'a Tuple> for Tuple
impl AddToTuple<Tuple> for Tuple