Skip to content

Commit

Permalink
rows_result: implement into_inner behind cpp_rust_unstable cfg
Browse files Browse the repository at this point in the history
This is convenience introduced only for cpp-rust-driver purposes.

We will use DeserializedMetadataAndRawRows directly to implement
lazy deserialization in cpp-rust-driver
  • Loading branch information
muzarski committed Dec 2, 2024
1 parent 49c342e commit 7581058
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scylla/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,8 @@ harness = false
[lints.rust]
unnameable_types = "warn"
unreachable_pub = "warn"
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(scylla_cloud_tests)', 'cfg(cassandra_tests)'] }
unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(scylla_cloud_tests)',
'cfg(cassandra_tests)',
'cfg(cpp_rust_unstable)',
] }
3 changes: 3 additions & 0 deletions scylla/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ pub mod frame {
pub(crate) use scylla_cql::frame::response::*;

pub mod result {
#[cfg(cpp_rust_unstable)]
pub use scylla_cql::frame::response::result::DeserializedMetadataAndRawRows;

pub(crate) use scylla_cql::frame::response::result::*;
pub use scylla_cql::frame::response::result::{
ColumnSpec, ColumnType, CqlValue, PartitionKeyIndex, Row, TableSpec,
Expand Down
11 changes: 11 additions & 0 deletions scylla/src/transport/query_result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,17 @@ impl QueryRowsResult {
Err(RowsError::TypeCheckFailed(err)) => Err(SingleRowError::TypeCheckFailed(err)),
}
}

#[cfg(cpp_rust_unstable)]
pub fn into_inner(self) -> (DeserializedMetadataAndRawRows, Option<Uuid>, Vec<String>) {
let Self {
raw_rows_with_metadata,
tracing_id,
warnings,
} = self;

(raw_rows_with_metadata, tracing_id, warnings)
}
}

/// An error returned by [`QueryResult::into_rows_result`]
Expand Down

0 comments on commit 7581058

Please sign in to comment.