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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
extern crate snap;
extern crate byteorder;
#[macro_use]
pub mod macros;
#[macro_use]
extern crate log;
extern crate lz4_compress;
extern crate uuid;
#[cfg(feature = "ssl")]
extern crate openssl;
extern crate r2d2;
extern crate rand;
extern crate time;
use std::io::Cursor;
pub mod frame;
pub mod types;
pub mod authenticators;
pub mod client;
pub mod cluster;
pub mod compression;
pub mod connection_manager;
pub mod consistency;
pub mod error;
pub mod events;
pub mod query;
pub mod transport;
pub trait IntoBytes {
fn into_cbytes(&self) -> Vec<u8>;
}
pub trait FromBytes {
fn from_bytes(&[u8]) -> error::Result<Self> where Self: Sized;
}
pub trait AsByte {
fn as_byte(&self) -> u8;
}
pub trait FromSingleByte {
fn from_byte(u8) -> Self;
}
pub trait FromCursor {
fn from_cursor(&mut Cursor<&[u8]>) -> error::Result<Self> where Self: Sized;
}
pub trait IntoCDRSValue {
fn into_cdrs_value(self) -> types::value::Value;
}
impl<T: Into<types::value::Bytes>> IntoCDRSValue for T {
fn into_cdrs_value(self) -> types::value::Value {
let bytes: types::value::Bytes = self.into();
bytes.into()
}
}