scylladb / scylla-rust-driver

Async CQL driver for Rust, optimized for ScyllaDB!
Apache License 2.0
582 stars 104 forks source link

New deserialization API - preparations #1065

Closed wprzytula closed 2 months ago

wprzytula commented 2 months ago

This PR consists the first bunch of minor preparatory steps for the main leap of the deserialization refactor, extracted from #1057 as @Lorak-mmk requested.

For explanation and broader context see #1057. Ref: #462

Pre-review checklist

github-actions[bot] commented 2 months ago

cargo semver-checks detected some API incompatibilities in this PR. Checked commit: d47aa812a3f1535620ee548030c2433a81326878

See the following report for details:

cargo semver-checks output ``` ./scripts/semver-checks.sh --baseline-rev 5752af488655287fc332ec3dd68645ef522e0d7c + cargo semver-checks -p scylla -p scylla-cql --baseline-rev 5752af488655287fc332ec3dd68645ef522e0d7c Cloning 5752af488655287fc332ec3dd68645ef522e0d7c Parsing scylla v0.13.0 (current) Parsed [ 22.765s] (current) Parsing scylla v0.13.0 (baseline) Parsed [ 20.042s] (baseline) Checking scylla v0.13.0 -> v0.13.0 (no change) Checked [ 0.079s] 79 checks: 78 pass, 1 fail, 0 warn, 0 skip --- failure struct_pub_field_missing: pub struct's pub field removed or renamed --- Description: A publicly-visible struct has at least one public field that is no longer available under its prior name. It may have been renamed or removed entirely. ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.34.0/src/lints/struct_pub_field_missing.ron Failed in: field col_specs of struct QueryResult, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-5752af488655287fc332ec3dd68645ef522e0d7c/e5083df900adadf2ab85ec0d0ea2d0b0e87030b8/scylla/src/transport/query_result.rs:22 field col_specs of struct QueryResult, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-5752af488655287fc332ec3dd68645ef522e0d7c/e5083df900adadf2ab85ec0d0ea2d0b0e87030b8/scylla/src/transport/query_result.rs:22 Summary semver requires new major version: 1 major and 0 minor checks failed Finished [ 42.933s] scylla Parsing scylla-cql v0.2.0 (current) Parsed [ 10.073s] (current) Parsing scylla-cql v0.2.0 (baseline) Parsed [ 10.049s] (baseline) Checking scylla-cql v0.2.0 -> v0.2.0 (no change) Checked [ 0.084s] 79 checks: 76 pass, 3 fail, 0 warn, 0 skip --- failure constructible_struct_adds_field: externally-constructible struct adds field --- Description: A pub struct constructible with a struct literal has a new pub field. Existing struct literals must be updated to include the new field. ref: https://doc.rust-lang.org/reference/expressions/struct-expr.html impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.34.0/src/lints/constructible_struct_adds_field.ron Failed in: field Rows.paging_state_response in /home/runner/work/scylla-rust-driver/scylla-rust-driver/scylla-cql/src/frame/response/result.rs:490 --- failure enum_variant_added: enum variant added on exhaustive enum --- Description: A publicly-visible enum without #[non_exhaustive] has a new variant. ref: https://doc.rust-lang.org/cargo/reference/semver.html#enum-variant-new impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.34.0/src/lints/enum_variant_added.ron Failed in: variant ParseError:DeserializationTypeCheckError in /home/runner/work/scylla-rust-driver/scylla-rust-driver/scylla-cql/src/frame/frame_errors.rs:49 --- failure struct_pub_field_missing: pub struct's pub field removed or renamed --- Description: A publicly-visible struct has at least one public field that is no longer available under its prior name. It may have been renamed or removed entirely. ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.34.0/src/lints/struct_pub_field_missing.ron Failed in: field paging_state of struct ResultMetadata, previously in file /home/runner/work/scylla-rust-driver/scylla-rust-driver/target/semver-checks/git-5752af488655287fc332ec3dd68645ef522e0d7c/e5083df900adadf2ab85ec0d0ea2d0b0e87030b8/scylla-cql/src/frame/response/result.rs:434 Summary semver requires new major version: 3 major and 0 minor checks failed Finished [ 20.256s] scylla-cql make: *** [Makefile:61: semver-rev] Error 1 ```
wprzytula commented 2 months ago

v1.1: reverted paging_state.clone() to paging_state.take() in iterator.

wprzytula commented 2 months ago

v1.1.1: fixed tests in QueryResult.

wprzytula commented 2 months ago

v1.2: rebased on main.

wprzytula commented 2 months ago

v1.2.1: fixed compile error on MSRV due to: error[E0277]: the trait bound `[u8]: Default` is not satisfied