pub trait IntoMapKey:
IntoValue
+ Eq
+ Hash
+ Ord {
// Provided method
fn into_mapkey(self) -> MapKey { ... }
}
Expand description
Trait for converting values into CEL map keys.
IntoMapKey
provides conversion from Rust types to CEL MapKey
instances.
Only types that are valid CEL map key types can implement this trait.
§Examples
use cel_cxx::{IntoMapKey, MapKey};
// Convert various types to map keys
let string_key = "key".into_mapkey();
let int_key = 42i64.into_mapkey();
let bool_key = true.into_mapkey();
assert_eq!(string_key, MapKey::String("key".to_string().into()));
assert_eq!(int_key, MapKey::Int(42));
assert_eq!(bool_key, MapKey::Bool(true));
Provided Methods§
Sourcefn into_mapkey(self) -> MapKey
fn into_mapkey(self) -> MapKey
Converts this value into a CEL MapKey
.
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.