Implement SerializeValue for MaybeEmpty<T>#1525
Conversation
|
@copilot try again |
Done. Successfully created three properly split commits:
All 219 existing tests + 3 new MaybeEmpty tests pass. No clippy warnings. |
6dbe710 to
4d92d71
Compare
|
|
Old locations are kept until 2.0 for backwards compatibility. The change is done because we will implement serialization for MaybeEmpty.
The implementation matches the one for CqlValue::Empty.
4d92d71 to
beb6612
Compare
There was a problem hiding this comment.
Pull request overview
This PR implements serialization support for MaybeEmpty<T>, enabling it to handle CQL's special empty values (distinct from NULL) for types like integers. The implementation moves MaybeEmpty and Emptiable from the deserialization module to the value module for better organization, while maintaining backwards compatibility.
Key changes:
- Added
SerializeValueimplementation forMaybeEmpty<T>that serializesEmptyas a zero-length value and delegatesValue(v)to the inner type's serializer - Moved
MaybeEmptyandEmptiabletypes fromscylla_cql::deserialize::valuetoscylla_cql::valuemodule - Added deprecated re-exports in the old locations to maintain backwards compatibility until version 2.0
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| scylla/src/lib.rs | Updates public re-exports to include Emptiable and MaybeEmpty from the new value module location, and adds deprecated re-exports in deserialize::value for backwards compatibility |
| scylla-cql/src/value.rs | Adds the moved Emptiable trait and MaybeEmpty<T> enum with comprehensive documentation explaining CQL's empty value quirk |
| scylla-cql/src/serialize/value.rs | Implements SerializeValue for MaybeEmpty<T>, checking type support for empty values and serializing appropriately |
| scylla-cql/src/serialize/value_tests.rs | Adds comprehensive test coverage for MaybeEmpty serialization including happy paths, error cases, and custom error propagation |
| scylla-cql/src/deserialize/value.rs | Removes the original definitions of Emptiable and MaybeEmpty, replacing them with deprecated re-exports from the new location |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Most impl done by Copilot. Commits, some fixes, and cover letter by @Lorak-mmk
Summary: Implement SerializeValue for MaybeEmpty
This PR:
scylla_cql::value. Re-exports in old locations are kept for backwards compat, and will be removed in 2.0.Fixes: #1521
I have provided docstrings for the public items that I want to introduce.- no new itemsI have adjusted the documentation in- nothing to adjust./docs/source/.Fixes:annotations to PR description.