cel_cxx/values/impls/
string.rs1use super::{impl_from, impl_into, impl_typed};
2use crate::{types::*, values::*};
3
4impl_typed!(
5 String: Value, MapKey {
6 StringValue,
7 String,
8 Box<str>,
9 str
10 }
11);
12
13impl_into!(
14 String: Value, MapKey, Constant {
15 StringValue => |self| self,
16 String => |self| self.into(),
17 Box<str> => |self| self.into(),
18 &str => |self| self.into(),
19 }
20);
21
22impl_from!(
23 String: Value, MapKey {
24 StringValue => |v| v.clone(),
25 String => |v| v.to_string(),
26 Box<str> => |v| Box::from(v.as_slice()),
27 &StringValue as &'a StringValue => |v| v,
28 &str as &'a str => |v| v.as_slice(),
29 }
30);