pub trait TypedMapKey: TypedValue {
// Provided method
fn mapkey_type() -> MapKeyType { ... }
}
Expand description
Trait for types that can be used as map keys and have a known CEL map key type.
TypedMapKey
provides static type information for map key types.
This trait is used alongside IntoMapKey
for complete map key functionality.
§Examples
use cel_cxx::{TypedMapKey, MapKeyType};
// Built-in types implement this automatically
assert_eq!(String::mapkey_type(), MapKeyType::String);
assert_eq!(i64::mapkey_type(), MapKeyType::Int);
Provided Methods§
Sourcefn mapkey_type() -> MapKeyType
fn mapkey_type() -> MapKeyType
Returns the CEL map key type for this type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.