MCPcopy Create free account
hub / github.com/cel-rust/cel-rust / is_zero

Method is_zero

cel/src/objects.rs:643–658  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

641 }
642
643 pub fn is_zero(&self) -> bool {
644 match self {
645 Value::List(v) => v.is_empty(),
646 Value::Map(v) => v.map.is_empty(),
647 Value::Int(0) => true,
648 Value::UInt(0) => true,
649 Value::Float(f) => *f == 0.0,
650 Value::String(v) => v.is_empty(),
651 Value::Bytes(v) => v.is_empty(),
652 Value::Bool(false) => true,
653 #[cfg(feature = "chrono")]
654 Value::Duration(v) => v.is_zero(),
655 Value::Null => true,
656 _ => false,
657 }
658 }
659
660 pub fn error_expected_type(&self, expected: ValueType) -> ExecutionError {
661 ExecutionError::UnexpectedType {

Callers 2

is_zero_valueMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected