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

Method parse

nodedb/src/event/alert/types.rs:70–80  ·  view source on GitHub ↗

Parse from SQL operator string.

(s: &str)

Source from the content-addressed store, hash-verified

68impl CompareOp {
69 /// Parse from SQL operator string.
70 pub fn parse(s: &str) -> Option<Self> {
71 match s.trim() {
72 ">" => Some(Self::Gt),
73 ">=" => Some(Self::Gte),
74 "<" => Some(Self::Lt),
75 "<=" => Some(Self::Lte),
76 "=" | "==" => Some(Self::Eq),
77 "!=" | "<>" => Some(Self::Neq),
78 _ => None,
79 }
80 }
81
82 /// Evaluate the comparison.
83 pub fn evaluate(&self, value: f64, threshold: f64) -> bool {

Callers 15

parse_sparse_keyFunction · 0.45
parse_spatial_keyFunction · 0.45
execute_grouping_setsFunction · 0.45
newMethod · 0.45
finalizeMethod · 0.45
parse_retention_periodFunction · 0.45
parse_utc_timestampFunction · 0.45
parse_offset_keyFunction · 0.45
check_healthzFunction · 0.45

Calls

no outgoing calls