Skip to content

Commit f9a3635

Browse files
authored
Merge pull request #1090 from Lorak-mmk/serialization_exports
scylla/lib.rs: Remove stars in serialization frameworks imports
2 parents 01255af + dcd1790 commit f9a3635

File tree

5 files changed

+81
-3
lines changed

5 files changed

+81
-3
lines changed

scylla-cql/src/types/serialize/batch.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
//! Contains the [`BatchValues`] and [`BatchValuesIterator`] trait and their
22
//! implementations.
33
4+
// Note: When editing above doc-comment edit the corresponding comment on
5+
// re-export module in scylla crate too.
6+
47
use crate::frame::value::{LegacyBatchValues, LegacyBatchValuesIterator};
58

69
use super::row::{RowSerializationContext, SerializeRow};

scylla-cql/src/types/serialize/row.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
//! Contains the [`SerializeRow`] trait and its implementations.
22
3+
// Note: When editing above doc-comment edit the corresponding comment on
4+
// re-export module in scylla crate too.
5+
36
use std::borrow::Cow;
47
use std::collections::{BTreeMap, HashSet};
58
use std::fmt::Display;

scylla-cql/src/types/serialize/value.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
//! Contains the [`SerializeValue`] trait and its implementations.
22
3+
// Note: When editing above doc-comment edit the corresponding comment on
4+
// re-export module in scylla crate too.
5+
36
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
47
use std::fmt::Display;
58
use std::hash::BuildHasher;

scylla-cql/src/types/serialize/writers.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
//! Contains types and traits used for safe serialization of values for a CQL statement.
22
3+
// Note: When editing above doc-comment edit the corresponding comment on
4+
// re-export module in scylla crate too.
5+
36
use thiserror::Error;
47

58
use super::row::SerializedValues;

scylla/src/lib.rs

Lines changed: 69 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@
6363
//! # Ok(())
6464
//! # }
6565
//! ```
66-
//! But the driver will accept anything implementing the trait [SerializeRow]
67-
//! (crate::serialize::row::SerializeRow)
66+
//! But the driver will accept anything implementing the trait [SerializeRow].
6867
//!
6968
//! ### Receiving results
7069
//! 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 {
131130
}
132131

133132
/// Serializing bound values of a query to be sent to the DB.
133+
// Note: When editing comment on submodules here edit corresponding comments
134+
// on scylla-cql modules too.
134135
pub mod serialize {
135-
pub use scylla_cql::types::serialize::*;
136+
pub use scylla_cql::types::serialize::SerializationError;
137+
/// Contains the [BatchValues][batch::BatchValues] and [BatchValuesIterator][batch::BatchValuesIterator] trait and their
138+
/// implementations.
139+
pub mod batch {
140+
// Main types
141+
pub use scylla_cql::types::serialize::batch::{
142+
BatchValues, BatchValuesFromIterator, BatchValuesIterator,
143+
BatchValuesIteratorFromIterator, TupleValuesIter,
144+
};
145+
146+
// Legacy migration types - to be removed when removing legacy framework
147+
pub use scylla_cql::types::serialize::batch::{
148+
LegacyBatchValuesAdapter, LegacyBatchValuesIteratorAdapter,
149+
};
150+
}
151+
152+
/// Contains the [SerializeRow][row::SerializeRow] trait and its implementations.
153+
pub mod row {
154+
// Main types
155+
pub use scylla_cql::types::serialize::row::{RowSerializationContext, SerializeRow};
156+
157+
// Errors
158+
pub use scylla_cql::types::serialize::row::{
159+
BuiltinSerializationError, BuiltinSerializationErrorKind, BuiltinTypeCheckError,
160+
BuiltinTypeCheckErrorKind,
161+
};
162+
163+
// Legacy migration types - to be removed when removing legacy framework
164+
pub use scylla_cql::types::serialize::row::{
165+
// Legacy migration types - to be removed when removing legacy framework
166+
serialize_legacy_row,
167+
ValueListAdapter,
168+
ValueListToSerializeRowAdapterError,
169+
};
170+
171+
// Not part of the old framework, but something that we should
172+
// still aim to remove from public API.
173+
pub use scylla_cql::types::serialize::row::{SerializedValues, SerializedValuesIterator};
174+
}
175+
176+
/// Contains the [SerializeValue][value::SerializeValue] trait and its implementations.
177+
pub mod value {
178+
// Main types
179+
pub use scylla_cql::types::serialize::value::SerializeValue;
180+
181+
// Errors
182+
pub use scylla_cql::types::serialize::value::{
183+
BuiltinSerializationError, BuiltinSerializationErrorKind, BuiltinTypeCheckError,
184+
BuiltinTypeCheckErrorKind, MapSerializationErrorKind, MapTypeCheckErrorKind,
185+
SetOrListSerializationErrorKind, SetOrListTypeCheckErrorKind,
186+
TupleSerializationErrorKind, TupleTypeCheckErrorKind, UdtSerializationErrorKind,
187+
UdtTypeCheckErrorKind,
188+
};
189+
190+
// Legacy migration types - to be removed when removing legacy framework
191+
pub use scylla_cql::types::serialize::value::{
192+
serialize_legacy_value, ValueAdapter, ValueToSerializeValueAdapterError,
193+
};
194+
}
195+
196+
/// Contains types and traits used for safe serialization of values for a CQL statement.
197+
pub mod writers {
198+
pub use scylla_cql::types::serialize::writers::{
199+
CellOverflowError, CellValueBuilder, CellWriter, RowWriter, WrittenCellProof,
200+
};
201+
}
136202
}
137203

138204
/// Deserializing DB response containing CQL query results.

0 commit comments

Comments
 (0)