FrameColumnData

Enum FrameColumnData 

Source
pub enum FrameColumnData {
Show 27 variants Bool(BoolContainer), Float4(NumberContainer<f32>), Float8(NumberContainer<f64>), Int1(NumberContainer<i8>), Int2(NumberContainer<i16>), Int4(NumberContainer<i32>), Int8(NumberContainer<i64>), Int16(NumberContainer<i128>), Uint1(NumberContainer<u8>), Uint2(NumberContainer<u16>), Uint4(NumberContainer<u32>), Uint8(NumberContainer<u64>), Uint16(NumberContainer<u128>), Utf8(Utf8Container), Date(TemporalContainer<Date>), DateTime(TemporalContainer<DateTime>), Time(TemporalContainer<Time>), Duration(TemporalContainer<Duration>), IdentityId(IdentityIdContainer), Uuid4(UuidContainer<Uuid4>), Uuid7(UuidContainer<Uuid7>), Blob(BlobContainer), Int(NumberContainer<Int>), Uint(NumberContainer<Uint>), Decimal(NumberContainer<Decimal>), Any(AnyContainer), Undefined(UndefinedContainer),
}

Variants§

Implementations§

Source§

impl FrameColumnData

Source

pub fn get_type(&self) -> Type

Source

pub fn is_defined(&self, idx: usize) -> bool

Source

pub fn is_bool(&self) -> bool

Source

pub fn is_float(&self) -> bool

Source

pub fn is_utf8(&self) -> bool

Source

pub fn is_number(&self) -> bool

Source

pub fn is_text(&self) -> bool

Source

pub fn is_temporal(&self) -> bool

Source

pub fn is_uuid(&self) -> bool

Source

pub fn iter<'a>(&'a self) -> Box<dyn Iterator<Item = Value> + 'a>

Source§

impl FrameColumnData

Source

pub fn len(&self) -> usize

Examples found in repository?
examples/test_remote_sort.rs (line 38)
4fn main() -> Result<(), Box<dyn std::error::Error>> {
5	println!("Connecting to ws://192.168.100.52:8090/\n");
6
7	// Connect to the remote server
8	let client = Client::ws(("192.168.100.52", 8090))?;
9
10	// Try with auth token from environment or use "root"
11	let token = std::env::var("REIFYDB_TOKEN").unwrap_or_else(|_| "root".to_string());
12	println!(
13		"Using auth token: {}\n",
14		if token == "root" {
15			"root (default)"
16		} else {
17			&token
18		}
19	);
20
21	// Create a blocking session with auth token
22	let mut session = client.blocking_session(Some(token))?;
23
24	println!("Connected successfully!\n");
25
26	// Test ASC
27	println!("=== TEST 1: ASC (should show smallest first) ===");
28	println!("Query:");
29	println!("from system.table_storage_stats");
30	println!("sort total_bytes asc\n");
31
32	let query_asc = "from system.table_storage_stats\nsort total_bytes asc";
33	let result_asc = session.query(query_asc, None)?;
34
35	if let Some(frame) = result_asc.frames.first() {
36		if let Some(total_bytes_col) = frame.columns.iter().find(|c| c.name == "total_bytes") {
37			let mut values: Vec<u64> = Vec::new();
38			for i in 0..total_bytes_col.data.len() {
39				let val = total_bytes_col.data.as_string(i).parse::<u64>().unwrap_or(0);
40				values.push(val);
41			}
42			println!("ASC Results: {:?}", values);
43			println!("First value (should be smallest): {}", values[0]);
44			println!("Last value (should be largest): {}\n", values[values.len() - 1]);
45		}
46	}
47
48	// Test DESC
49	println!("=== TEST 2: DESC (should show largest first) ===");
50	println!("Query:");
51	println!("from system.table_storage_stats");
52	println!("sort total_bytes desc\n");
53
54	let query = "from system.table_storage_stats\nsort total_bytes desc";
55	let result = session.query(query, None)?;
56
57	println!("Query executed: {} frames returned\n", result.frames.len());
58
59	// Print the results
60	if let Some(frame) = result.frames.first() {
61		println!("Frame output:");
62		println!("{}\n", frame);
63
64		// Also analyze the data
65		if let Some(total_bytes_col) = frame.columns.iter().find(|c| c.name == "total_bytes") {
66			println!("=== Analyzing total_bytes column ===");
67			let mut values: Vec<u64> = Vec::new();
68			for i in 0..total_bytes_col.data.len() {
69				let val = total_bytes_col.data.as_string(i).parse::<u64>().unwrap_or(0);
70				values.push(val);
71				println!("Row {}: {} bytes", i, val);
72			}
73
74			println!("\nValues in order: {:?}", values);
75
76			// Check if sorted correctly (DESC = largest first)
77			let mut is_desc_sorted = true;
78			for i in 1..values.len() {
79				if values[i - 1] < values[i] {
80					is_desc_sorted = false;
81					println!(
82						"\n⚠️  SORTING ERROR at position {}: {} < {}",
83						i,
84						values[i - 1],
85						values[i]
86					);
87				}
88			}
89
90			if is_desc_sorted {
91				println!("\n✅ Correctly sorted in DESCENDING order (largest first)");
92			} else {
93				println!("\n❌ NOT correctly sorted in descending order!");
94				println!("   Expected: Largest value first, decreasing values");
95				println!("   Got: {:?}", values);
96			}
97		}
98	}
99
100	Ok(())
101}
Source

pub fn as_string(&self, index: usize) -> String

Examples found in repository?
examples/test_remote_sort.rs (line 39)
4fn main() -> Result<(), Box<dyn std::error::Error>> {
5	println!("Connecting to ws://192.168.100.52:8090/\n");
6
7	// Connect to the remote server
8	let client = Client::ws(("192.168.100.52", 8090))?;
9
10	// Try with auth token from environment or use "root"
11	let token = std::env::var("REIFYDB_TOKEN").unwrap_or_else(|_| "root".to_string());
12	println!(
13		"Using auth token: {}\n",
14		if token == "root" {
15			"root (default)"
16		} else {
17			&token
18		}
19	);
20
21	// Create a blocking session with auth token
22	let mut session = client.blocking_session(Some(token))?;
23
24	println!("Connected successfully!\n");
25
26	// Test ASC
27	println!("=== TEST 1: ASC (should show smallest first) ===");
28	println!("Query:");
29	println!("from system.table_storage_stats");
30	println!("sort total_bytes asc\n");
31
32	let query_asc = "from system.table_storage_stats\nsort total_bytes asc";
33	let result_asc = session.query(query_asc, None)?;
34
35	if let Some(frame) = result_asc.frames.first() {
36		if let Some(total_bytes_col) = frame.columns.iter().find(|c| c.name == "total_bytes") {
37			let mut values: Vec<u64> = Vec::new();
38			for i in 0..total_bytes_col.data.len() {
39				let val = total_bytes_col.data.as_string(i).parse::<u64>().unwrap_or(0);
40				values.push(val);
41			}
42			println!("ASC Results: {:?}", values);
43			println!("First value (should be smallest): {}", values[0]);
44			println!("Last value (should be largest): {}\n", values[values.len() - 1]);
45		}
46	}
47
48	// Test DESC
49	println!("=== TEST 2: DESC (should show largest first) ===");
50	println!("Query:");
51	println!("from system.table_storage_stats");
52	println!("sort total_bytes desc\n");
53
54	let query = "from system.table_storage_stats\nsort total_bytes desc";
55	let result = session.query(query, None)?;
56
57	println!("Query executed: {} frames returned\n", result.frames.len());
58
59	// Print the results
60	if let Some(frame) = result.frames.first() {
61		println!("Frame output:");
62		println!("{}\n", frame);
63
64		// Also analyze the data
65		if let Some(total_bytes_col) = frame.columns.iter().find(|c| c.name == "total_bytes") {
66			println!("=== Analyzing total_bytes column ===");
67			let mut values: Vec<u64> = Vec::new();
68			for i in 0..total_bytes_col.data.len() {
69				let val = total_bytes_col.data.as_string(i).parse::<u64>().unwrap_or(0);
70				values.push(val);
71				println!("Row {}: {} bytes", i, val);
72			}
73
74			println!("\nValues in order: {:?}", values);
75
76			// Check if sorted correctly (DESC = largest first)
77			let mut is_desc_sorted = true;
78			for i in 1..values.len() {
79				if values[i - 1] < values[i] {
80					is_desc_sorted = false;
81					println!(
82						"\n⚠️  SORTING ERROR at position {}: {} < {}",
83						i,
84						values[i - 1],
85						values[i]
86					);
87				}
88			}
89
90			if is_desc_sorted {
91				println!("\n✅ Correctly sorted in DESCENDING order (largest first)");
92			} else {
93				println!("\n❌ NOT correctly sorted in descending order!");
94				println!("   Expected: Largest value first, decreasing values");
95				println!("   Got: {:?}", values);
96			}
97		}
98	}
99
100	Ok(())
101}
Source§

impl FrameColumnData

Source

pub fn get_value(&self, index: usize) -> Value

Trait Implementations§

Source§

impl Clone for FrameColumnData

Source§

fn clone(&self) -> FrameColumnData

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FrameColumnData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for FrameColumnData

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<FrameColumnData, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for FrameColumnData

Source§

fn eq(&self, other: &FrameColumnData) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for FrameColumnData

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for FrameColumnData

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,