Skip to content

Commit 3e2a94d

Browse files
committed
column_specs: pubify and rename (de)constructors
Users might want to construct it manually, or convert `ColumnSpecs` back to raw slice.
1 parent 83556ed commit 3e2a94d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

scylla/src/client/pager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ impl QueryPager {
646646
pub fn type_check<'frame, 'metadata, RowT: DeserializeRow<'frame, 'metadata>>(
647647
&self,
648648
) -> Result<(), TypeCheckError> {
649-
RowT::type_check(self.column_specs().inner())
649+
RowT::type_check(self.column_specs().as_slice())
650650
}
651651

652652
/// Casts the iterator to a given row type, enabling [Stream]'ed operations

scylla/src/response/query_result.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ pub struct ColumnSpecs<'slice, 'spec> {
1818
}
1919

2020
impl<'slice, 'spec> ColumnSpecs<'slice, 'spec> {
21-
pub(crate) fn new(specs: &'slice [ColumnSpec<'spec>]) -> Self {
21+
/// Creates new [`ColumnSpecs`] wrapper from a slice.
22+
pub fn new(specs: &'slice [ColumnSpec<'spec>]) -> Self {
2223
Self { specs }
2324
}
2425

25-
pub(crate) fn inner(&self) -> &'slice [ColumnSpec<'spec>] {
26+
/// Returns a slice of col specs encompassed by this struct.
27+
pub fn as_slice(&self) -> &'slice [ColumnSpec<'spec>] {
2628
self.specs
2729
}
2830

0 commit comments

Comments
 (0)