MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / usize_arg

Function usize_arg

nodedb-query/src/window/value_eval.rs:190–198  ·  view source on GitHub ↗
(spec: &WindowFuncSpec, idx: usize, default: usize)

Source from the content-addressed store, hash-verified

188}
189
190fn usize_arg(spec: &WindowFuncSpec, idx: usize, default: usize) -> usize {
191 spec.args
192 .get(idx)
193 .and_then(|e| match e {
194 SqlExpr::Literal(v) => v.as_f64().map(|n| n as usize),
195 _ => None,
196 })
197 .unwrap_or(default)
198}
199
200fn default_arg_value(spec: &WindowFuncSpec, idx: usize) -> Value {
201 spec.args

Callers 4

apply_v_ntileFunction · 0.70
apply_v_lagFunction · 0.70
apply_v_leadFunction · 0.70
apply_v_nth_valueFunction · 0.70

Calls 2

getMethod · 0.45
as_f64Method · 0.45

Tested by

no test coverage detected