turbo_tasks/
key_value_pair.rs1use std::fmt::Debug;
2
3pub trait KeyValuePair {
4 type Type: Debug + Copy + Clone + PartialEq + Eq + std::hash::Hash;
5 type Key: Debug + Clone + PartialEq + Eq + std::hash::Hash;
6 type Value: Debug + Clone + Default + PartialEq + Eq;
7 type ValueRef<'l>: Debug + Copy + Clone + PartialEq + Eq + 'l
8 where
9 Self: 'l;
10 type ValueRefMut<'l>: Debug + PartialEq + Eq + 'l
11 where
12 Self: 'l;
13 fn ty(&self) -> Self::Type;
14 fn key(&self) -> Self::Key;
15 fn value(&self) -> Self::Value;
16 fn value_ref(&self) -> Self::ValueRef<'_>;
17 fn value_mut(&mut self) -> Self::ValueRefMut<'_>;
18 fn from_key_and_value(key: Self::Key, value: Self::Value) -> Self;
19 fn from_key_and_value_ref(key: Self::Key, value_ref: Self::ValueRef<'_>) -> Self;
20 fn into_key_and_value(self) -> (Self::Key, Self::Value);
21}
22
23pub use turbo_tasks_macros::KeyValuePair;