cassandra-rs v0.10.0 Release Notes
Release Date: 2017-08-03 // over 6 years ago-
The API changed significantly in version 0.10. Here is a summary of the main changes. (Version 0.9 was skipped, for consistency with the
cassandra-cpp-sys
version number.)Errors:
- The internal module
errors
and the underlyingcassandra-cpp-sys
crate are no longer exposed in the API. All necessary types are defined in this crate's root module. - All errors are now reported consistently using a single newly-defined
Error
type.- The crate makes every effort to return an error rather than panicking.
CassError
,CassErrorResult
, and others are replaced byError
andCassErrorCode
.- Several return types have changed from
T
toResult<T, Error>
.
Futures:
- There is only a single future type,
CassFuture
, and it implements the Rust/Tokio futures API. It interoperates smoothly with existing futures code.Future
,CloseFuture
,ResultFuture
,PreparedFuture
,SessionFuture
are all subsumed.wait
is replaced withFuture::wait
; other methods have standard analogues as well. See the [futures]((https://docs.rs/futures)) documentation for details.- Callbacks can no longer be set explicitly on a future; instead the normal
futures mechanisms (e.g.,
and_then
) should be used.
Values:
- The
Column
type is retired; instead useValue
. - Some
Value
getters have new names for consistency, e.g.,get_flt
andget_dbl
are nowget_f32
andget_f64
respectively. Value::get_string
now gets aString
, not a&str
; you can get a&str
withget_str
.- The "magic" auto-converting
Row
gettersget_col
andget_col_by_name
are renamed toget
andget_by_name
respectively. This is to avoid confusion withget_column
, which is something else entirely (it gets aValue
from aRow
). - Values have a new
is_null
method to allow retrieving null values. - ๐ UUIDs now support
Eq
andOrd
.
Miscellaneous types:
- Several types which wrapped
cassandra-cpp-sys
types now have enums of their own, complete with implementations ofDebug
,Eq
,PartialEq
,Display
, andFromStr
. This includesBatchType
,CassErrorCode
,Consistency
,LogLevel
,SslVerifyFlag
, andValueType
. CqlProtocol
is now simply an alias for an integer.- Contact points are now expressed as a simple string in the driver's preferred format.
ContactPoints
is retired.
Other:
- ๐ฒ Logging uses the
slog
crate. It is no longer possible to set your own logging callback, but you can set theslog
logger. - โ Internally, the code is cleaner and smaller and some tests have been added.
- The internal module