cassandra-rs v0.17.0 Release Notes

Release Date: 2021-05-17 // almost 3 years ago
  • ๐Ÿ”„ Changed

    • Changed Session::execute_batch and Session::execute_batch_with_payloads to take only a reference to Batch rather than consuming it.

    This is a breaking change; to update your code, simply change batch to &batch in your argument list. If this causes an error future cannot be sent between threads safely because &Batch is used across an await, you need to introduce a let before the await as follows:

      let fut = session.execute_batch(&batch);
      let result = fut.await?
    

Previous changes from v0.16.0

  • โž• Added

    • ๐Ÿ”ฆ Exposes separate setters for collection types on Tuple and UserType. As such, the respective set_collection and set_collection_by_name on both types have been removed. set_collection becomes set_set and set_collection_by_name becomes set_set_by_name.
      • Added Cluster::set_token_aware_routing_shuffle_replicas.
    • ๐Ÿ‘‰ ConstDataType::new_user_type has been added, to allow the creation of a user data type from an existing data type.
    • Added Session::execute_with_payloads and Session::execute_batch_with_payloads to allow getting custom payloads from query and batch executions.

    ๐Ÿ’ฅ Breaking changes

    • Extended the lifetime of a CassResult into a Row. This is a breaking change, and may require reworking the code to satisfy the lifetime requirement that the CassResult must live longer than the Row.
    • CassCollection::new has been renamed to CassCollection::with_capacity, and CassCollection::new has been created, that no longer requires a capacity. This closely mirrors the API that the standard library collections expose, and that the item_count passed to new is merely a capacity hint for the purpose of optimization.
    • time::Duration has been replaced with std::time::Duration.

    ๐Ÿ”„ Changed

    • ๐Ÿ”„ Change various functions to avoid the extra overhead using an intermediate CString object.
    • ๐Ÿ”€ Switched to using parking_lot::Mutex instead of std::sync::Mutex for CassFuture coordination.
    • Implemented size_hint on ResultIterator.
    • โฌ†๏ธ Bumped versions of various dependencies.

    ๐Ÿ›  Fixed

    • CassResult::set_paging_state_token was implemented incorrectly, namely, it did nothing, and has instead been replaced with CassResult::paging_state_token.
    • Statement::set_paging_state_token has been changed to take a &[u8] instead of a &str, as a paging state token isn't necessarily utf8 encoded.