Skip to content

Commit ee84038

Browse files
committed
treewide: Sprinkle Debug across the result types
In the next commit we will want to call Option<CassResultValue>::expect(). It requires Debug implementation.
1 parent 7c6227f commit ee84038

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

scylla-rust-wrapper/src/future.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use std::sync::{Arc, Condvar, Mutex};
1717
use tokio::task::JoinHandle;
1818
use tokio::time::Duration;
1919

20+
#[derive(Debug)]
2021
pub enum CassResultValue {
2122
Empty,
2223
QueryResult(Arc<CassResult>),

scylla-rust-wrapper/src/query_result.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,20 @@ use std::sync::Arc;
2929
use thiserror::Error;
3030
use uuid::Uuid;
3131

32+
#[derive(Debug)]
3233
pub enum CassResultKind {
3334
NonRows,
3435
Rows(CassRowsResult),
3536
}
3637

38+
#[derive(Debug)]
3739
pub struct CassRowsResult {
3840
// Arc: shared with first_row (yoke).
3941
pub(crate) shared_data: Arc<CassRowsResultSharedData>,
4042
pub(crate) first_row: Option<RowWithSelfBorrowedResultData>,
4143
}
4244

45+
#[derive(Debug)]
4346
pub(crate) struct CassRowsResultSharedData {
4447
pub(crate) raw_rows: DeserializedMetadataAndRawRows,
4548
// Arc: shared with CassPrepared
@@ -53,6 +56,7 @@ impl FFI for CassNode {
5356
type Origin = FromRef;
5457
}
5558

59+
#[derive(Debug)]
5660
pub struct CassResult {
5761
pub tracing_id: Option<Uuid>,
5862
pub paging_state_response: PagingStateResponse,
@@ -159,6 +163,7 @@ impl<'frame, 'metadata> DeserializeRow<'frame, 'metadata> for CassRawRow<'frame,
159163

160164
/// The lifetime of CassRow is bound to CassResult.
161165
/// It will be freed, when CassResult is freed.(see #[cass_result_free])
166+
#[derive(Debug)]
162167
pub struct CassRow<'result> {
163168
pub columns: Vec<CassValue<'result>>,
164169
pub result_metadata: &'result CassResultMetadata,
@@ -230,7 +235,7 @@ mod row_with_self_borrowed_result_data {
230235

231236
/// A simple wrapper over CassRow.
232237
/// Needed, so we can implement Yokeable for it, instead of implementing it for CassRow.
233-
#[derive(Yokeable)]
238+
#[derive(Debug, Yokeable)]
234239
struct CassRowWrapper<'result>(CassRow<'result>);
235240

236241
/// A wrapper over struct which self-borrows the metadata allocated using Arc.
@@ -243,6 +248,7 @@ mod row_with_self_borrowed_result_data {
243248
///
244249
/// This struct is a shared owner of the row bytes and metadata, and self-borrows this data
245250
/// to the `CassRow` it contains.
251+
#[derive(Debug)]
246252
pub struct RowWithSelfBorrowedResultData(
247253
Yoke<CassRowWrapper<'static>, Arc<CassRowsResultSharedData>>,
248254
);
@@ -307,6 +313,7 @@ pub(crate) mod cass_raw_value {
307313
use scylla::errors::{DeserializationError, TypeCheckError};
308314
use thiserror::Error;
309315

316+
#[derive(Debug)]
310317
pub(crate) struct CassRawValue<'frame, 'metadata> {
311318
typ: &'metadata ColumnType<'metadata>,
312319
slice: Option<FrameSlice<'frame>>,
@@ -428,6 +435,7 @@ pub(crate) mod cass_raw_value {
428435
}
429436
}
430437

438+
#[derive(Debug)]
431439
pub struct CassValue<'result> {
432440
pub(crate) value: CassRawValue<'result, 'result>,
433441
pub(crate) value_type: &'result Arc<CassDataType>,

0 commit comments

Comments
 (0)