Anonymizable

Trait Anonymizable 

Source
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§

Source

fn quasi_identifiers(&self) -> Vec<QuasiIdentifierTypes>

return the values of the quasi identifiers in the data struct

Source

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

Source

fn sensitive_value(&self) -> SensitiveAttribute

return a copy of the sensitive attribute of the struct

Source

fn extract_string_values(&self, uuid: Uuid, dr: f64) -> Vec<String>

extract all the values in string format to be used for creating CSV

Source

fn get_timestamp(&self) -> SystemTime

Provided Methods§

Source

fn calculate_difference(&self, other: &Self) -> f64

compare 2 data points and return the euclidean difference between them

Source

fn calculate_info_loss(&self, other: &Self) -> f64

calculate the info loss between 2 different Anonymizable structs

Source

fn suppress(&self) -> Self

suppress the qi’s based on a buffer of Anonymizables

Source

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

Source

fn calculate_interval_distance( interval_x: IntervalType, interval_y: IntervalType, ) -> f64

calculate the euclidean distance between 2 interval data types

Source

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.

Implementors§