MCPcopy Create free account
hub / github.com/AmrDeveloper/GQL / window_nth_value

Function window_nth_value

crates/gitql-std/src/window.rs:79–93  ·  view source on GitHub ↗
(frame: &[Vec<Box<dyn Value>>])

Source from the content-addressed store, hash-verified

77}
78
79pub fn window_nth_value(frame: &[Vec<Box<dyn Value>>]) -> Vec<Box<dyn Value>> {
80 let frame_len = frame.len();
81 let index = frame[0][1].as_int().unwrap();
82
83 let mut values: Vec<Box<dyn Value>> = Vec::with_capacity(frame_len);
84 for _ in 0..frame_len {
85 if index < 0 || index as usize >= frame_len {
86 values.push(Box::new(NullValue));
87 } else {
88 values.push(frame[index as usize][0].clone());
89 };
90 }
91
92 values
93}
94
95pub fn window_last_value(frame: &[Vec<Box<dyn Value>>]) -> Vec<Box<dyn Value>> {
96 let frame_len = frame.len();

Callers

nothing calls this directly

Calls 2

as_intMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…