Skip to main content

luaur_analysis/records/
path_hash.rs

1//! @interface-stub
2use crate::enums::pack_field::PackField;
3use crate::enums::type_field::TypeField;
4use crate::records::generic_pack_mapping::GenericPackMapping;
5use crate::records::index::Index;
6use crate::records::pack_slice::PackSlice;
7use crate::records::path::Path;
8use crate::records::property_type_path::Property;
9use crate::records::reduction::Reduction;
10use crate::type_aliases::component::Component;
11
12#[derive(Debug, Clone)]
13pub struct PathHash;
14
15impl PathHash {
16    pub fn operator_property(&self, prop: &Property) -> usize {
17        self.operator_call_7(prop)
18    }
19    pub fn operator_index(&self, idx: &Index) -> usize {
20        self.operator_call_3(idx)
21    }
22    pub fn operator_type_field(&self, field: &TypeField) -> usize {
23        self.operator_call_9(field)
24    }
25    pub fn operator_pack_field(&self, field: &PackField) -> usize {
26        self.operator_call_4(field)
27    }
28    pub fn operator_pack_slice(&self, slice: &PackSlice) -> usize {
29        self.operator_call_5(slice)
30    }
31    pub fn operator_reduction(&self, reduction: &Reduction) -> usize {
32        self.operator_call_8(reduction)
33    }
34    pub fn operator_generic_pack_mapping(&self, mapping: &GenericPackMapping) -> usize {
35        self.operator_call_2(mapping)
36    }
37    pub fn operator_component(&self, component: &Component) -> usize {
38        match component {
39            Component::Property(prop) => self.operator_property(prop),
40            Component::Index(idx) => self.operator_index(idx),
41            Component::TypeField(field) => self.operator_type_field(field),
42            Component::PackField(field) => self.operator_pack_field(field),
43            Component::PackSlice(slice) => self.operator_pack_slice(slice),
44            Component::Reduction(reduction) => self.operator_reduction(reduction),
45            Component::GenericPackMapping(mapping) => self.operator_generic_pack_mapping(mapping),
46        }
47    }
48    pub fn operator_path(&self, path: &Path) -> usize {
49        self.operator_call_6(path)
50    }
51}