MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / containsAddress

Function containsAddress

codelab/network_functions.cc:349–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

347}
348
349cel::Value containsAddress(const cel::OpaqueValue& matcher,
350 const cel::OpaqueValue& addr) {
351 const auto* matcher_rep = NetworkAddressMatcher::Unwrap(matcher);
352 auto addr_rep = NetworkAddressRep::Unwrap(addr);
353 if (matcher_rep == nullptr || !addr_rep.has_value()) {
354 // dispatcher should catch this, but right now only distiguishes at the
355 // kind level.
356 return cel::ErrorValue(absl::InvalidArgumentError("no matching overload"));
357 }
358 return cel::BoolValue(matcher_rep->Match(*addr_rep));
359}
360
361} // namespace
362

Callers

nothing calls this directly

Calls 4

ErrorValueFunction · 0.85
MatchMethod · 0.80
BoolValueClass · 0.50
has_valueMethod · 0.45

Tested by

no test coverage detected