pub trait Anonymizable:
Default
+ Clone
+ Serialize
+ Sync {
// Required methods
fn quasi_identifiers(&self) -> Vec<QuasiIdentifierTypes>;
fn update_quasi_identifiers(&self, qi: Vec<QuasiIdentifierTypes>) -> Self;
fn sensitive_value(&self) -> SensitiveAttribute;
fn extract_string_values(&self, uuid: Uuid, dr: f64) -> Vec<String>;
fn get_timestamp(&self) -> SystemTime;
// Provided methods
fn calculate_difference(&self, other: &Self) -> f64 { ... }
fn calculate_info_loss(&self, other: &Self) -> f64 { ... }
fn suppress(&self) -> Self { ... }
fn calculate_ordinal_distance(
ordinal_x: OrdinalType,
ordinal_y: OrdinalType,
) -> f64 { ... }
fn calculate_interval_distance(
interval_x: IntervalType,
interval_y: IntervalType,
) -> f64 { ... }
fn calculate_nominal_distance(
nominal_x: NominalType,
nominal_y: NominalType,
) -> f64 { ... }
}Expand description
The role of this trait is to create a generic way of making sure that the struct can be anonymized using the Anonymizer
Required Methods§
Sourcefn quasi_identifiers(&self) -> Vec<QuasiIdentifierTypes>
fn quasi_identifiers(&self) -> Vec<QuasiIdentifierTypes>
return the values of the quasi identifiers in the data struct
Sourcefn update_quasi_identifiers(&self, qi: Vec<QuasiIdentifierTypes>) -> Self
fn update_quasi_identifiers(&self, qi: Vec<QuasiIdentifierTypes>) -> Self
return a copy of the Anonymizable struct and replace its quasi identifier attributes with given QI’s we return a copy because we want to keep the original intact for new aggregation
Sourcefn sensitive_value(&self) -> SensitiveAttribute
fn sensitive_value(&self) -> SensitiveAttribute
return a copy of the sensitive attribute of the struct
Sourcefn extract_string_values(&self, uuid: Uuid, dr: f64) -> Vec<String>
fn extract_string_values(&self, uuid: Uuid, dr: f64) -> Vec<String>
extract all the values in string format to be used for creating CSV
fn get_timestamp(&self) -> SystemTime
Provided Methods§
Sourcefn calculate_difference(&self, other: &Self) -> f64
fn calculate_difference(&self, other: &Self) -> f64
compare 2 data points and return the euclidean difference between them
Sourcefn calculate_info_loss(&self, other: &Self) -> f64
fn calculate_info_loss(&self, other: &Self) -> f64
calculate the info loss between 2 different Anonymizable structs
Sourcefn calculate_ordinal_distance(
ordinal_x: OrdinalType,
ordinal_y: OrdinalType,
) -> f64
fn calculate_ordinal_distance( ordinal_x: OrdinalType, ordinal_y: OrdinalType, ) -> f64
calculate the euclidean distance between 2 ordinal data category types TODO: clarify that ranking starts at 1
Sourcefn calculate_interval_distance(
interval_x: IntervalType,
interval_y: IntervalType,
) -> f64
fn calculate_interval_distance( interval_x: IntervalType, interval_y: IntervalType, ) -> f64
calculate the euclidean distance between 2 interval data types
Sourcefn calculate_nominal_distance(
nominal_x: NominalType,
nominal_y: NominalType,
) -> f64
fn calculate_nominal_distance( nominal_x: NominalType, nominal_y: NominalType, ) -> f64
calculate the euclidean distance between 2 nominal data types
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.