discord_cassandra_cpp/cassandra/
consistency.rs

1use crate::cassandra::util::Protected;
2use crate::cassandra_sys::CassConsistency_;
3
4use crate::cassandra_sys::cass_consistency_string;
5
6use std::ffi::CStr;
7
8/// A Cassandra consistency level.
9#[derive(Debug, Eq, PartialEq, Copy, Clone, Hash)]
10#[allow(missing_docs)] // Meanings are defined in CQL documentation.
11#[allow(non_camel_case_types)] // Names are traditional.
12pub enum Consistency {
13    UNKNOWN,
14    ANY,
15    ONE,
16    TWO,
17    THREE,
18    QUORUM,
19    ALL,
20    LOCAL_QUORUM,
21    EACH_QUORUM,
22    SERIAL,
23    LOCAL_SERIAL,
24    LOCAL_ONE,
25}
26
27enhance_nullary_enum!(Consistency, CassConsistency_, {
28    (UNKNOWN, CASS_CONSISTENCY_UNKNOWN, "UNKNOWN"),
29    (ANY, CASS_CONSISTENCY_ANY, "ANY"),
30    (ONE, CASS_CONSISTENCY_ONE, "ONE"),
31    (TWO, CASS_CONSISTENCY_TWO, "TWO"),
32    (THREE, CASS_CONSISTENCY_THREE, "THREE"),
33    (QUORUM, CASS_CONSISTENCY_QUORUM, "QUORUM"),
34    (ALL, CASS_CONSISTENCY_ALL, "ALL"),
35    (LOCAL_QUORUM, CASS_CONSISTENCY_LOCAL_QUORUM, "LOCAL_QUORUM"),
36    (EACH_QUORUM, CASS_CONSISTENCY_EACH_QUORUM, "EACH_QUORUM"),
37    (SERIAL, CASS_CONSISTENCY_SERIAL, "SERIAL"),
38    (LOCAL_SERIAL, CASS_CONSISTENCY_LOCAL_SERIAL, "LOCAL_SERIAL"),
39    (LOCAL_ONE, CASS_CONSISTENCY_LOCAL_ONE, "LOCAL_ONE"),
40});