Struct binary_tuples::Tuple [] [src]

pub struct Tuple { /* fields omitted */ }

A builder for serialized tuples

Methods

impl Tuple
[src]

[src]

Create a new tuple

[src]

Create a new tuple with a fixed backing capacity

[src]

Create a new tuple from an existing byte array

This can be used with as_segments to parse an existing tuple into a list of segments

Examples

use binary_tuples::{Tuple, segment::Segment};

let binary = vec![2, 117, 115, 101, 114, 115, 0, 21, 1];

let tuple = Tuple::from_bytes(&binary)
    .as_segments()
    .unwrap();

assert_eq!(tuple, vec![Segment::String(String::from("users")), Segment::Integer(1)]);

[src]

Add an individual segment to this tuple.

Notes

It is recommended to import AddToTuple as it greatly simplifies this API

[src]

Directly embed the contents of another tuple builder in this builder

Notes

This is more efficient than adding a segment slice as the backing buffer can be memcopied.

[src]

Return a serialized tuple

[src]

Return a serialized tuple

[src]

Deserialize the segments which make up this tuple

Trait Implementations

impl Clone for Tuple
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl AddToTuple<i64> for Tuple
[src]

[src]

Add a new segment to a tuple

[src]

A fluent interface for adding a new segment to a tuple Read more

impl AddToTuple<String> for Tuple
[src]

[src]

Add a new segment to a tuple

[src]

A fluent interface for adding a new segment to a tuple Read more

impl<'a> AddToTuple<&'a [u8]> for Tuple
[src]

[src]

Add a new segment to a tuple

[src]

A fluent interface for adding a new segment to a tuple Read more

impl<'a> AddToTuple<&'a Vec<u8>> for Tuple
[src]

[src]

Add a new segment to a tuple

[src]

A fluent interface for adding a new segment to a tuple Read more

impl AddToTuple<f32> for Tuple
[src]

[src]

Add a new segment to a tuple

[src]

A fluent interface for adding a new segment to a tuple Read more

impl AddToTuple<f64> for Tuple
[src]

[src]

Add a new segment to a tuple

[src]

A fluent interface for adding a new segment to a tuple Read more

impl AddToTuple<Vec<u8>> for Tuple
[src]

[src]

Add a new segment to a tuple

[src]

A fluent interface for adding a new segment to a tuple Read more

impl AddToTuple<&'static str> for Tuple
[src]

[src]

Add a new segment to a tuple

[src]

A fluent interface for adding a new segment to a tuple Read more

impl AddToTuple<Uuid> for Tuple
[src]

[src]

Add a new segment to a tuple

[src]

A fluent interface for adding a new segment to a tuple Read more

impl AddToTuple<Vec<Segment>> for Tuple
[src]

[src]

Add a new segment to a tuple

[src]

A fluent interface for adding a new segment to a tuple Read more

impl<'a> AddToTuple<&'a Tuple> for Tuple
[src]

[src]

Add a new segment to a tuple

[src]

A fluent interface for adding a new segment to a tuple Read more

impl AddToTuple<Tuple> for Tuple
[src]

[src]

Add a new segment to a tuple

[src]

A fluent interface for adding a new segment to a tuple Read more

Auto Trait Implementations

impl Send for Tuple

impl Sync for Tuple