pub struct ConditionKey {
pub u64_value: Option<u64>,
pub string_value: String,
}
Expand description
DCS v2 stores conditions in a map. This means that for each evaluation, we do a lookup from the Rule.conditions vec to the top level condition_map.
Given that we know the keys are a djb2 hash, we can convert them to u64 numbers during deserialization. Having these keys as numbers makes the lookup a lot faster as the “hash” for the HashMap is just the u64 integer.
I have included fallback support for Strings in-case the DCS payload changes in the future
Fields§
§u64_value: Option<u64>
§string_value: String
Trait Implementations§
Source§impl Debug for ConditionKey
impl Debug for ConditionKey
Source§impl<'de> Deserialize<'de> for ConditionKey
impl<'de> Deserialize<'de> for ConditionKey
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for ConditionKey
impl Hash for ConditionKey
Source§impl PartialEq for ConditionKey
impl PartialEq for ConditionKey
Source§impl Serialize for ConditionKey
impl Serialize for ConditionKey
impl Eq for ConditionKey
impl StructuralPartialEq for ConditionKey
Auto Trait Implementations§
impl Freeze for ConditionKey
impl RefUnwindSafe for ConditionKey
impl Send for ConditionKey
impl Sync for ConditionKey
impl Unpin for ConditionKey
impl UnwindSafe for ConditionKey
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
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.