diff --git a/scylla-cql/src/lib.rs b/scylla-cql/src/lib.rs index b8d7d28671..47b58b4f4e 100644 --- a/scylla-cql/src/lib.rs +++ b/scylla-cql/src/lib.rs @@ -3,8 +3,6 @@ pub mod frame; #[macro_use] pub mod macros; -pub mod types; - pub use crate::frame::response::cql_to_rust; pub use crate::frame::response::cql_to_rust::FromRow; diff --git a/scylla-cql/src/types/mod.rs b/scylla-cql/src/types/mod.rs deleted file mode 100644 index ec9942a885..0000000000 --- a/scylla-cql/src/types/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod serialize; diff --git a/scylla-cql/src/types/serialize/mod.rs b/scylla-cql/src/types/serialize/mod.rs deleted file mode 100644 index 0cda84e252..0000000000 --- a/scylla-cql/src/types/serialize/mod.rs +++ /dev/null @@ -1,6 +0,0 @@ -use std::{any::Any, sync::Arc}; - -pub mod row; -pub mod value; - -type SerializationError = Arc; diff --git a/scylla-cql/src/types/serialize/row.rs b/scylla-cql/src/types/serialize/row.rs deleted file mode 100644 index 2e9832412d..0000000000 --- a/scylla-cql/src/types/serialize/row.rs +++ /dev/null @@ -1,49 +0,0 @@ -use std::sync::Arc; - -use crate::frame::response::result::ColumnSpec; -use crate::frame::value::ValueList; - -use super::SerializationError; - -pub struct RowSerializationContext<'a> { - columns: &'a [ColumnSpec], -} - -impl<'a> RowSerializationContext<'a> { - #[inline] - pub fn columns(&self) -> &'a [ColumnSpec] { - self.columns - } - - // TODO: change RowSerializationContext to make this faster - #[inline] - pub fn column_by_name(&self, target: &str) -> Option<&ColumnSpec> { - self.columns.iter().find(|&c| c.name == target) - } -} - -pub trait SerializeRow { - fn preliminary_type_check(ctx: &RowSerializationContext<'_>) -> Result<(), SerializationError>; - fn serialize( - &self, - ctx: &RowSerializationContext<'_>, - out: &mut Vec, - ) -> Result<(), SerializationError>; -} - -impl SerializeRow for T { - fn preliminary_type_check( - _ctx: &RowSerializationContext<'_>, - ) -> Result<(), SerializationError> { - Ok(()) - } - - fn serialize( - &self, - _ctx: &RowSerializationContext<'_>, - out: &mut Vec, - ) -> Result<(), SerializationError> { - self.write_to_request(out) - .map_err(|err| Arc::new(err) as SerializationError) - } -} diff --git a/scylla-cql/src/types/serialize/value.rs b/scylla-cql/src/types/serialize/value.rs deleted file mode 100644 index 43eb9ef738..0000000000 --- a/scylla-cql/src/types/serialize/value.rs +++ /dev/null @@ -1,22 +0,0 @@ -use std::sync::Arc; - -use crate::frame::response::result::ColumnType; -use crate::frame::value::Value; - -use super::SerializationError; - -pub trait SerializeCql { - fn preliminary_type_check(typ: &ColumnType) -> Result<(), SerializationError>; - fn serialize(&self, typ: &ColumnType, buf: &mut Vec) -> Result<(), SerializationError>; -} - -impl SerializeCql for T { - fn preliminary_type_check(_typ: &ColumnType) -> Result<(), SerializationError> { - Ok(()) - } - - fn serialize(&self, _typ: &ColumnType, buf: &mut Vec) -> Result<(), SerializationError> { - self.serialize(buf) - .map_err(|err| Arc::new(err) as SerializationError) - } -}