TODO: provide more details and link to examples
In ordert to query information from Cassandra DB and transform results to Rust types an structures each row in a query result should be transformed leveraging one of following traits provided by CDRS cdrs::types::{AsRustType, AsRust, IntoRustByName, ByName, IntoRustByIndex, ByIndex}.
-
AsRustTypemay be used in order to transform such complex structures as Cassandra lists, sets, tuples. The Cassandra value in this case could non-set and null values. -
AsRusttrait may be used for similar purposes asAsRustTypebut it assumes that Cassandra value is neither non-set nor null value. Otherwise it panics. -
IntoRustByNametrait may be used to access a value as a Rust structure/type by name. Such as in case of rows where each column has its own name, and maps. These values may be as well non-set and null. -
ByNametrait is the same asIntoRustByNamebut value should be neither non-set nor null. Otherwise it panics. -
IntoRustByIndexis the same asIntoRustByNamebut values could be accessed via column index basing on their order provided in query. These values may be as well non-set and null. -
ByIndexis the same asIntoRustByIndexbut value can be neither non-set nor null. Otherwise it panics.
Relations between Cassandra and Rust types are described in type-mapping.md. For details see examples.