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

Method as_float

crates/gitql-core/src/values/base.rs:379–384  ·  view source on GitHub ↗

Return List of [`f64`] represent the inner value of [`FloatValue`] or None if this type it's called from wrong [`Value`]

(&self)

Source from the content-addressed store, hash-verified

377 /// Return List of [`f64`] represent the inner value of [`FloatValue`]
378 /// or None if this type it's called from wrong [`Value`]
379 pub fn as_float(&self) -> Option<f64> {
380 if let Some(float_value) = self.as_any().downcast_ref::<FloatValue>() {
381 return Some(float_value.value);
382 }
383 None
384 }
385
386 /// Return true if this value is [`IntValue`] or [`FloatValue`]
387 pub fn is_number(&self) -> bool {

Callers 15

group_eq_opMethod · 0.80
group_bang_eq_opMethod · 0.80
group_gt_opMethod · 0.80
group_gte_opMethod · 0.80
group_lt_opMethod · 0.80
group_lte_opMethod · 0.80
numeric_absFunction · 0.80
numeric_floorFunction · 0.80
numeric_roundFunction · 0.80
numeric_sinFunction · 0.80
numeric_asinFunction · 0.80
numeric_cosFunction · 0.80

Calls 1

as_anyMethod · 0.45

Tested by

no test coverage detected