From 77d184616547ed48d85c1447913998390ee5bed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Przytu=C5=82a?= Date: Wed, 11 Dec 2024 14:40:31 +0100 Subject: [PATCH] frame/value: deprecate SerializeValuesError This is part of the legacy serialization framework. --- scylla-cql/src/frame/value.rs | 4 ++++ scylla/src/transport/errors.rs | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/scylla-cql/src/frame/value.rs b/scylla-cql/src/frame/value.rs index 0db6f503a..a2ee409f9 100644 --- a/scylla-cql/src/frame/value.rs +++ b/scylla-cql/src/frame/value.rs @@ -25,6 +25,10 @@ pub struct ValueTooBig; pub struct ValueOverflow; #[allow(deprecated)] +#[deprecated( + since = "0.15.1", + note = "Legacy serialization API is not type-safe and is going to be removed soon" +)] #[derive(Debug, Error, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub enum SerializeValuesError { #[error("Too many values to add, max 65,535 values can be sent in a request")] diff --git a/scylla/src/transport/errors.rs b/scylla/src/transport/errors.rs index 7d835f269..fdd5b9aa0 100644 --- a/scylla/src/transport/errors.rs +++ b/scylla/src/transport/errors.rs @@ -12,6 +12,7 @@ use std::{ sync::Arc, }; +#[allow(deprecated)] use scylla_cql::{ frame::{ frame_errors::{ @@ -124,6 +125,7 @@ pub enum QueryError { IntoLegacyQueryResultError(#[from] IntoLegacyQueryResultError), } +#[allow(deprecated)] impl From for QueryError { fn from(serialized_err: SerializeValuesError) -> QueryError { QueryError::BadQuery(BadQuery::SerializeValuesError(serialized_err)) @@ -573,7 +575,12 @@ pub enum ViewsMetadataError { #[non_exhaustive] pub enum BadQuery { /// Failed to serialize values passed to a query - values too big + #[deprecated( + since = "0.15.1", + note = "Legacy serialization API is not type-safe and is going to be removed soon" + )] #[error("Serializing values failed: {0} ")] + #[allow(deprecated)] SerializeValuesError(#[from] SerializeValuesError), #[error("Serializing values failed: {0} ")]