Skip to content

Commit 04eb40a

Browse files
committed
scylla/lib.rs: Remove stars in serialization frameworks imports
It is easier to see what is imported, and decide if it should be, if one can see what exactly is imported. This is hard to do with stars, so, as part of API stabilization effort, those are removed here. For now, I did not remove any imports, so this change should not be breaking.
1 parent eb14ca8 commit 04eb40a

File tree

6 files changed

+92
-1
lines changed

6 files changed

+92
-1
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/raw_batch.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
//! Contains the [`RawBatchValues`] and [`RawBatchValuesIterator`] 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 super::batch::{BatchValues, BatchValuesIterator};
58
use super::row::{RowSerializationContext, SerializedValues};
69
use super::{RowWriter, SerializationError};

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: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,84 @@ pub mod frame {
131131
}
132132

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

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

0 commit comments

Comments
 (0)