#[non_exhaustive]pub struct DifferentialPrivacyPolicy {
pub max_epsilon_per_query: Option<f64>,
pub delta_per_query: Option<f64>,
pub max_groups_contributed: Option<i64>,
pub privacy_unit_column: Option<String>,
pub epsilon_budget: Option<f64>,
pub delta_budget: Option<f64>,
pub epsilon_budget_remaining: Option<f64>,
pub delta_budget_remaining: Option<f64>,
/* private fields */
}Expand description
Represents privacy policy associated with “differential privacy” method.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_epsilon_per_query: Option<f64>Optional. The maximum epsilon value that a query can consume. If the subscriber specifies epsilon as a parameter in a SELECT query, it must be less than or equal to this value. The epsilon parameter controls the amount of noise that is added to the groups — a higher epsilon means less noise.
delta_per_query: Option<f64>Optional. The delta value that is used per query. Delta represents the probability that any row will fail to be epsilon differentially private. Indicates the risk associated with exposing aggregate rows in the result of a query.
max_groups_contributed: Option<i64>Optional. The maximum groups contributed value that is used per query. Represents the maximum number of groups to which each protected entity can contribute. Changing this value does not improve or worsen privacy. The best value for accuracy and utility depends on the query and data.
privacy_unit_column: Option<String>Optional. The privacy unit column associated with this policy. Differential privacy policies can only have one privacy unit column per data source object (table, view).
epsilon_budget: Option<f64>Optional. The total epsilon budget for all queries against the privacy-protected view. Each subscriber query against this view charges the amount of epsilon they request in their query. If there is sufficient budget, then the subscriber query attempts to complete. It might still fail due to other reasons, in which case the charge is refunded. If there is insufficient budget the query is rejected. There might be multiple charge attempts if a single query references multiple views. In this case there must be sufficient budget for all charges or the query is rejected and charges are refunded in best effort. The budget does not have a refresh policy and can only be updated via ALTER VIEW or circumvented by creating a new view that can be queried with a fresh budget.
delta_budget: Option<f64>Optional. The total delta budget for all queries against the privacy-protected view. Each subscriber query against this view charges the amount of delta that is pre-defined by the contributor through the privacy policy delta_per_query field. If there is sufficient budget, then the subscriber query attempts to complete. It might still fail due to other reasons, in which case the charge is refunded. If there is insufficient budget the query is rejected. There might be multiple charge attempts if a single query references multiple views. In this case there must be sufficient budget for all charges or the query is rejected and charges are refunded in best effort. The budget does not have a refresh policy and can only be updated via ALTER VIEW or circumvented by creating a new view that can be queried with a fresh budget.
epsilon_budget_remaining: Option<f64>Output only. The epsilon budget remaining. If budget is exhausted, no more queries are allowed. Note that the budget for queries that are in progress is deducted before the query executes. If the query fails or is cancelled then the budget is refunded. In this case the amount of budget remaining can increase.
delta_budget_remaining: Option<f64>Output only. The delta budget remaining. If budget is exhausted, no more queries are allowed. Note that the budget for queries that are in progress is deducted before the query executes. If the query fails or is cancelled then the budget is refunded. In this case the amount of budget remaining can increase.
Implementations§
Source§impl DifferentialPrivacyPolicy
impl DifferentialPrivacyPolicy
Sourcepub fn set_max_epsilon_per_query<T>(self, v: T) -> Self
pub fn set_max_epsilon_per_query<T>(self, v: T) -> Self
Sets the value of max_epsilon_per_query.
§Example
let x = DifferentialPrivacyPolicy::new().set_max_epsilon_per_query(42.0);Sourcepub fn set_or_clear_max_epsilon_per_query<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_max_epsilon_per_query<T>(self, v: Option<T>) -> Self
Sets or clears the value of max_epsilon_per_query.
§Example
let x = DifferentialPrivacyPolicy::new().set_or_clear_max_epsilon_per_query(Some(42.0));
let x = DifferentialPrivacyPolicy::new().set_or_clear_max_epsilon_per_query(None::<f32>);Sourcepub fn set_delta_per_query<T>(self, v: T) -> Self
pub fn set_delta_per_query<T>(self, v: T) -> Self
Sets the value of delta_per_query.
§Example
let x = DifferentialPrivacyPolicy::new().set_delta_per_query(42.0);Sourcepub fn set_or_clear_delta_per_query<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_delta_per_query<T>(self, v: Option<T>) -> Self
Sets or clears the value of delta_per_query.
§Example
let x = DifferentialPrivacyPolicy::new().set_or_clear_delta_per_query(Some(42.0));
let x = DifferentialPrivacyPolicy::new().set_or_clear_delta_per_query(None::<f32>);Sourcepub fn set_max_groups_contributed<T>(self, v: T) -> Self
pub fn set_max_groups_contributed<T>(self, v: T) -> Self
Sets the value of max_groups_contributed.
§Example
let x = DifferentialPrivacyPolicy::new().set_max_groups_contributed(42);Sourcepub fn set_or_clear_max_groups_contributed<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_max_groups_contributed<T>(self, v: Option<T>) -> Self
Sets or clears the value of max_groups_contributed.
§Example
let x = DifferentialPrivacyPolicy::new().set_or_clear_max_groups_contributed(Some(42));
let x = DifferentialPrivacyPolicy::new().set_or_clear_max_groups_contributed(None::<i32>);Sourcepub fn set_privacy_unit_column<T>(self, v: T) -> Self
pub fn set_privacy_unit_column<T>(self, v: T) -> Self
Sets the value of privacy_unit_column.
§Example
let x = DifferentialPrivacyPolicy::new().set_privacy_unit_column("example");Sourcepub fn set_or_clear_privacy_unit_column<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_privacy_unit_column<T>(self, v: Option<T>) -> Self
Sets or clears the value of privacy_unit_column.
§Example
let x = DifferentialPrivacyPolicy::new().set_or_clear_privacy_unit_column(Some("example"));
let x = DifferentialPrivacyPolicy::new().set_or_clear_privacy_unit_column(None::<String>);Sourcepub fn set_epsilon_budget<T>(self, v: T) -> Self
pub fn set_epsilon_budget<T>(self, v: T) -> Self
Sets the value of epsilon_budget.
§Example
let x = DifferentialPrivacyPolicy::new().set_epsilon_budget(42.0);Sourcepub fn set_or_clear_epsilon_budget<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_epsilon_budget<T>(self, v: Option<T>) -> Self
Sets or clears the value of epsilon_budget.
§Example
let x = DifferentialPrivacyPolicy::new().set_or_clear_epsilon_budget(Some(42.0));
let x = DifferentialPrivacyPolicy::new().set_or_clear_epsilon_budget(None::<f32>);Sourcepub fn set_delta_budget<T>(self, v: T) -> Self
pub fn set_delta_budget<T>(self, v: T) -> Self
Sets the value of delta_budget.
§Example
let x = DifferentialPrivacyPolicy::new().set_delta_budget(42.0);Sourcepub fn set_or_clear_delta_budget<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_delta_budget<T>(self, v: Option<T>) -> Self
Sets or clears the value of delta_budget.
§Example
let x = DifferentialPrivacyPolicy::new().set_or_clear_delta_budget(Some(42.0));
let x = DifferentialPrivacyPolicy::new().set_or_clear_delta_budget(None::<f32>);Sourcepub fn set_epsilon_budget_remaining<T>(self, v: T) -> Self
pub fn set_epsilon_budget_remaining<T>(self, v: T) -> Self
Sets the value of epsilon_budget_remaining.
§Example
let x = DifferentialPrivacyPolicy::new().set_epsilon_budget_remaining(42.0);Sourcepub fn set_or_clear_epsilon_budget_remaining<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_epsilon_budget_remaining<T>(self, v: Option<T>) -> Self
Sets or clears the value of epsilon_budget_remaining.
§Example
let x = DifferentialPrivacyPolicy::new().set_or_clear_epsilon_budget_remaining(Some(42.0));
let x = DifferentialPrivacyPolicy::new().set_or_clear_epsilon_budget_remaining(None::<f32>);Sourcepub fn set_delta_budget_remaining<T>(self, v: T) -> Self
pub fn set_delta_budget_remaining<T>(self, v: T) -> Self
Sets the value of delta_budget_remaining.
§Example
let x = DifferentialPrivacyPolicy::new().set_delta_budget_remaining(42.0);Sourcepub fn set_or_clear_delta_budget_remaining<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_delta_budget_remaining<T>(self, v: Option<T>) -> Self
Sets or clears the value of delta_budget_remaining.
§Example
let x = DifferentialPrivacyPolicy::new().set_or_clear_delta_budget_remaining(Some(42.0));
let x = DifferentialPrivacyPolicy::new().set_or_clear_delta_budget_remaining(None::<f32>);Trait Implementations§
Source§impl Clone for DifferentialPrivacyPolicy
impl Clone for DifferentialPrivacyPolicy
Source§fn clone(&self) -> DifferentialPrivacyPolicy
fn clone(&self) -> DifferentialPrivacyPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DifferentialPrivacyPolicy
impl Debug for DifferentialPrivacyPolicy
Source§impl Default for DifferentialPrivacyPolicy
impl Default for DifferentialPrivacyPolicy
Source§fn default() -> DifferentialPrivacyPolicy
fn default() -> DifferentialPrivacyPolicy
Source§impl Message for DifferentialPrivacyPolicy
impl Message for DifferentialPrivacyPolicy
impl StructuralPartialEq for DifferentialPrivacyPolicy
Auto Trait Implementations§
impl Freeze for DifferentialPrivacyPolicy
impl RefUnwindSafe for DifferentialPrivacyPolicy
impl Send for DifferentialPrivacyPolicy
impl Sync for DifferentialPrivacyPolicy
impl Unpin for DifferentialPrivacyPolicy
impl UnsafeUnpin for DifferentialPrivacyPolicy
impl UnwindSafe for DifferentialPrivacyPolicy
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request