Module pii_finder

Source
Expand description

This module takes the types and paths from ‘item_collector’ module, and will recursively find all the fields with the specified PII-value, and save those fields with the full path.

E.g. MyStruct.sub_struct.mystery_field.bitcoin_wallet_key, meaning you can find the full path from the top-level type all the way down to wherever the field with the correct PII-value resides.

Structs§

FieldsWithAttribute
PiiFinder
This is the visitor that actually generates the pii_types, it has a lot of associated data because it using the Visit trait from syn-crate means I cannot add data as arguments. The ‘pii_types’ field can be regarded as the output.
TypeAndField
The name of a field along with its type. Used for the path to a PII-field.

Functions§

get_attributes 🔒
Collects all the attributes from a given field.
get_field_types 🔒
This function extracts the type names from a complex type and stores them in a BTreeSet. It’s designed to handle nested generic types, such as Foo<Bar<Baz>>, and return [“Foo”, “Bar”, “Baz”].
get_matching_scoped_paths 🔒
Finds the full path to the given types by comparing them to the types in the scope.
get_type_paths_from_type 🔒