Trait IntoMapKey

Source
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§

Source

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.

Implementations on Foreign Types§

Source§

impl IntoMapKey for &str

Source§

impl IntoMapKey for bool

Source§

impl IntoMapKey for i16

Source§

impl IntoMapKey for i32

Source§

impl IntoMapKey for i64

Source§

impl IntoMapKey for isize

Source§

impl IntoMapKey for u16

Source§

impl IntoMapKey for u32

Source§

impl IntoMapKey for u64

Source§

impl IntoMapKey for usize

Source§

impl IntoMapKey for Box<str>

Source§

impl IntoMapKey for String

Source§

impl IntoMapKey for ArcStr

Source§

impl<T: IntoMapKey + Clone> IntoMapKey for &T

Source§

impl<T: IntoMapKey + Clone> IntoMapKey for &mut T

Implementors§