1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
use std::net::IpAddr;
use uuid::Uuid;
use frame::frame_result::{ColType, ColTypeOption, ColTypeOptionValue};
use types::{AsRust, AsRustType, CBytes};
use types::data_serialization_types::*;
use types::map::Map;
use types::udt::UDT;
use types::tuple::Tuple;
use types::blob::Blob;
use error::{Error, Result};
#[derive(Debug)]
pub struct List {
metadata: ColTypeOption,
data: Vec<CBytes>,
}
impl List {
pub fn new(data: Vec<CBytes>, metadata: ColTypeOption) -> List {
List { metadata: metadata,
data: data, }
}
fn map<T, F>(&self, f: F) -> Vec<T>
where F: FnMut(&CBytes) -> T
{
self.data.iter().map(f).collect()
}
}
impl AsRust for List {}
list_as_rust!(Blob);
list_as_rust!(String);
list_as_rust!(bool);
list_as_rust!(i64);
list_as_rust!(i32);
list_as_rust!(i16);
list_as_rust!(i8);
list_as_rust!(f64);
list_as_rust!(f32);
list_as_rust!(IpAddr);
list_as_rust!(Uuid);
list_as_rust!(List);
list_as_rust!(Map);
list_as_rust!(UDT);
list_as_rust!(Tuple);