Skip to content

Commit

Permalink
Merge pull request scylladb#1133 from muzarski/cpp-rust-decouple-quer…
Browse files Browse the repository at this point in the history
…y-rows-result

rows_result: implement into_inner behind `cpp_rust_unstable` cfg

(cherry picked from commit 62f96b3)
  • Loading branch information
Lorak-mmk authored and wprzytula committed Dec 11, 2024
1 parent 2b4faf0 commit d55b788
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
run: cargo clippy --verbose --all-targets
- name: Clippy check with all features
run: cargo clippy --verbose --all-targets --all-features
- name: Cargo check with cpp_rust_unstable cfg
run: RUSTFLAGS="--cfg cpp_rust_unstable" cargo clippy --verbose --all-targets --all-features
- name: Cargo check without features
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features ""
- name: Cargo check with all serialization features
Expand Down
5 changes: 4 additions & 1 deletion scylla/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,7 @@ harness = false
[lints.rust]
unnameable_types = "warn"
unreachable_pub = "warn"
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(scylla_cloud_tests)'] }
unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(scylla_cloud_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 d55b788

Please sign in to comment.