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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*!
This crate contains the core models/interfaces used by CQL Database.
It does not contain any implementations.
*/
use io;
use ;
/// The base CQL Value Type
///
/// All read/writable types to a CQL Database should derive from this.
///
/// # Examples
/// This declares a CQL Type to read/write Strings of a maximum length of 255 bytes from the database:
/// ```
/// pub struct TinyText;
///
/// impl CqlType for TinyText {
/// type ValueType = String;
/// const VALUE_SIZE: usize = 255;
/// }
/// ```
/// A CQL Value Type with single point write capability.
///
/// Allows the implementing type's [Self::ValueType](trait.CqlType.html#associatedtype.ValueType) to be written to a CQL database. It should not actively
/// validate that the given parameters are valid.
///
/// # Errors
///
/// Implementations of this function should return any [I/O errors](https://doc.rust-lang.org/nightly/std/io/enum.ErrorKind.html) encountered during the function.
/// If an error is returned it is not guaranteed that no bytes have been written.
///
/// [io::ErrorKind::Interrupted](https://doc.rust-lang.org/nightly/std/io/enum.ErrorKind.html#variant.Interrupted) errors should also be ignored and the write
/// continued.
///
/// # Panics
///
/// Implementations are allowed to panic if the given parameters are invalid, but they do not have to.
/// A CQL Value Type with single point read capability.
///
/// Allows the implementing type's [Self::ValueType](trait.CqlType.html#associatedtype.ValueType) to be read point-by-point from a CQL database.
/// It should not actively validate that the given parameters are valid.
///
/// # Errors
///
/// Implementations of this function should return any [I/O errors](https://doc.rust-lang.org/nightly/std/io/enum.ErrorKind.html) encountered during the function,
/// excluding [io::ErrorKind::UnexpectedEof](https://doc.rust-lang.org/nightly/std/io/enum.ErrorKind.html#variant.UnexpectedEof) errors on
/// read from the database which should result in the default value being returned.
///
/// [io::ErrorKind::Interrupted](https://doc.rust-lang.org/nightly/std/io/enum.ErrorKind.html#variant.Interrupted) errors should also be ignored and the read
/// continued.
///
/// # Panics
///
/// Implementations are allowed to panic if the given parameters are invalid, but they do not have to.
/// A CQL Value Type with stream read capability.
///
/// Allows a range of the implementing type's [Self::ValueType](trait.CqlType.html#associatedtype.ValueType) to be read to stream from a CQL database.
/// It should not actively validate that the given parameters are valid.
///
/// # Errors
///
/// Implementations of this function should return any [I/O errors](https://doc.rust-lang.org/nightly/std/io/enum.ErrorKind.html) encountered during the function,
/// excluding [io::ErrorKind::UnexpectedEof](https://doc.rust-lang.org/nightly/std/io/enum.ErrorKind.html#variant.UnexpectedEof) errors on
/// read from the database which should result in default values being written to the [Write](https://doc.rust-lang.org/std/io/trait.Write.html) stream.
/// If an error is returned it is not guaranteed that no bytes have been written to the stream.
///
/// [io::ErrorKind::Interrupted](https://doc.rust-lang.org/nightly/std/io/enum.ErrorKind.html#variant.Interrupted) errors should also be ignored and the read/write
/// continued.
///
/// # Panics
///
/// Implementations are allowed to panic if the given parameters are invalid, but they do not have to.