pub struct KeySpec {
pub id: String,
pub args: Vec<(String, ArgValue)>,
}Expand description
The key of one call: the entity id and any secondary dimensions.
Fields§
§id: StringThe entity identifier, spelled as text.
args: Vec<(String, ArgValue)>Secondary dimensions; absent values are dropped and names sorted when the key is built.
Implementations§
Source§impl KeySpec
impl KeySpec
Sourcepub fn new(id: impl IntoKeyId) -> Self
pub fn new(id: impl IntoKeyId) -> Self
A key with id and no secondary dimensions. See IntoKeyId for
the shared numeric spelling and supported input types.
Sourcepub fn arg(self, name: impl Into<String>, value: impl Into<ArgValue>) -> Self
pub fn arg(self, name: impl Into<String>, value: impl Into<ArgValue>) -> Self
Add a secondary key dimension. Absent values are omitted; names are
sorted by UTF-16 code units when the key is built. Primitive integers
preserve their exact decimal value; floats use JavaScript number
spelling, with f32 promoted to f64. Shared references to supported
inputs are also accepted.
Trait Implementations§
impl StructuralPartialEq for KeySpec
Auto Trait Implementations§
impl Freeze for KeySpec
impl RefUnwindSafe for KeySpec
impl Send for KeySpec
impl Sync for KeySpec
impl Unpin for KeySpec
impl UnsafeUnpin for KeySpec
impl UnwindSafe for KeySpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more