diff --git a/scylla-cql/src/types/serialize/batch.rs b/scylla-cql/src/types/serialize/batch.rs index 4fed3524a..2425b9073 100644 --- a/scylla-cql/src/types/serialize/batch.rs +++ b/scylla-cql/src/types/serialize/batch.rs @@ -1,6 +1,9 @@ //! Contains the [`BatchValues`] and [`BatchValuesIterator`] trait and their //! implementations. +// Note: When editing above doc-comment edit the corresponding comment on +// re-export module in scylla crate too. + use crate::frame::value::{LegacyBatchValues, LegacyBatchValuesIterator}; use super::row::{RowSerializationContext, SerializeRow}; diff --git a/scylla-cql/src/types/serialize/row.rs b/scylla-cql/src/types/serialize/row.rs index 78b69d94c..cd0388c86 100644 --- a/scylla-cql/src/types/serialize/row.rs +++ b/scylla-cql/src/types/serialize/row.rs @@ -1,5 +1,8 @@ //! Contains the [`SerializeRow`] trait and its implementations. +// Note: When editing above doc-comment edit the corresponding comment on +// re-export module in scylla crate too. + use std::borrow::Cow; use std::collections::{BTreeMap, HashSet}; use std::fmt::Display; diff --git a/scylla-cql/src/types/serialize/value.rs b/scylla-cql/src/types/serialize/value.rs index 6e28f92f9..22c3372c6 100644 --- a/scylla-cql/src/types/serialize/value.rs +++ b/scylla-cql/src/types/serialize/value.rs @@ -1,5 +1,8 @@ //! Contains the [`SerializeValue`] trait and its implementations. +// Note: When editing above doc-comment edit the corresponding comment on +// re-export module in scylla crate too. + use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet}; use std::fmt::Display; use std::hash::BuildHasher; diff --git a/scylla-cql/src/types/serialize/writers.rs b/scylla-cql/src/types/serialize/writers.rs index cfd36202b..f366d297a 100644 --- a/scylla-cql/src/types/serialize/writers.rs +++ b/scylla-cql/src/types/serialize/writers.rs @@ -1,5 +1,8 @@ //! Contains types and traits used for safe serialization of values for a CQL statement. +// Note: When editing above doc-comment edit the corresponding comment on +// re-export module in scylla crate too. + use thiserror::Error; use super::row::SerializedValues; diff --git a/scylla/src/lib.rs b/scylla/src/lib.rs index 3adce0fc0..a23692e3b 100644 --- a/scylla/src/lib.rs +++ b/scylla/src/lib.rs @@ -63,8 +63,7 @@ //! # Ok(()) //! # } //! ``` -//! But the driver will accept anything implementing the trait [SerializeRow] -//! (crate::serialize::row::SerializeRow) +//! But the driver will accept anything implementing the trait [SerializeRow]. //! //! ### Receiving results //! The easiest way to read rows returned by a query is to cast each row to a tuple of values: @@ -131,8 +130,75 @@ pub mod frame { } /// Serializing bound values of a query to be sent to the DB. +// Note: When editing comment on submodules here edit corresponding comments +// on scylla-cql modules too. pub mod serialize { - pub use scylla_cql::types::serialize::*; + pub use scylla_cql::types::serialize::SerializationError; + /// Contains the [BatchValues][batch::BatchValues] and [BatchValuesIterator][batch::BatchValuesIterator] trait and their + /// implementations. + pub mod batch { + // Main types + pub use scylla_cql::types::serialize::batch::{ + BatchValues, BatchValuesFromIterator, BatchValuesIterator, + BatchValuesIteratorFromIterator, TupleValuesIter, + }; + + // Legacy migration types - to be removed when removing legacy framework + pub use scylla_cql::types::serialize::batch::{ + LegacyBatchValuesAdapter, LegacyBatchValuesIteratorAdapter, + }; + } + + /// Contains the [SerializeRow][row::SerializeRow] trait and its implementations. + pub mod row { + // Main types + pub use scylla_cql::types::serialize::row::{RowSerializationContext, SerializeRow}; + + // Errors + pub use scylla_cql::types::serialize::row::{ + BuiltinSerializationError, BuiltinSerializationErrorKind, BuiltinTypeCheckError, + BuiltinTypeCheckErrorKind, + }; + + // Legacy migration types - to be removed when removing legacy framework + pub use scylla_cql::types::serialize::row::{ + // Legacy migration types - to be removed when removing legacy framework + serialize_legacy_row, + ValueListAdapter, + ValueListToSerializeRowAdapterError, + }; + + // Not part of the old framework, but something that we should + // still aim to remove from public API. + pub use scylla_cql::types::serialize::row::{SerializedValues, SerializedValuesIterator}; + } + + /// Contains the [SerializeValue][value::SerializeValue] trait and its implementations. + pub mod value { + // Main types + pub use scylla_cql::types::serialize::value::SerializeValue; + + // Errors + pub use scylla_cql::types::serialize::value::{ + BuiltinSerializationError, BuiltinSerializationErrorKind, BuiltinTypeCheckError, + BuiltinTypeCheckErrorKind, MapSerializationErrorKind, MapTypeCheckErrorKind, + SetOrListSerializationErrorKind, SetOrListTypeCheckErrorKind, + TupleSerializationErrorKind, TupleTypeCheckErrorKind, UdtSerializationErrorKind, + UdtTypeCheckErrorKind, + }; + + // Legacy migration types - to be removed when removing legacy framework + pub use scylla_cql::types::serialize::value::{ + serialize_legacy_value, ValueAdapter, ValueToSerializeValueAdapterError, + }; + } + + /// Contains types and traits used for safe serialization of values for a CQL statement. + pub mod writers { + pub use scylla_cql::types::serialize::writers::{ + CellOverflowError, CellValueBuilder, CellWriter, RowWriter, WrittenCellProof, + }; + } } /// Deserializing DB response containing CQL query results.