You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// TODO: Check whether we can reuse the OpenDP accountant if we want to use RDP/zCDP, without having to execute a measurement on real data. Check out the `compose` function here: https://docs.rs/opendp/latest/opendp/measures/struct.ZeroConcentratedDivergence.html, check if they offer filters directly.
9
11
10
12
#[derive(Debug)]
@@ -31,6 +33,10 @@ impl Filter<PureDPBudget> for PureDPBudgetFilter {
Copy file name to clipboardExpand all lines: src/budget/traits.rs
+20-5Lines changed: 20 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,10 @@
1
-
// TODO: maybe Budget trait, and Filter<T: Budget> if we need?
2
-
3
1
use thiserror::Error;
4
2
3
+
/// Trait for privacy budgets
4
+
pubtraitBudget:Clone{
5
+
// For now just a marker trait requiring Clone
6
+
}
7
+
5
8
/// Error returned when trying to consume from a filter.
6
9
#[derive(Error,Debug)]
7
10
pubenumFilterError{
@@ -10,12 +13,18 @@ pub enum FilterError {
10
13
}
11
14
12
15
/// Trait for a privacy filter.
13
-
pubtraitFilter<T>{
16
+
pubtraitFilter<T:Budget>{
14
17
/// Initializes a new filter with a given capacity.
15
18
fnnew(capacity:T) -> Self;
16
19
17
-
/// Tries to consume a given budget from the filter. In the formalism from https://arxiv.org/abs/1605.08294, Ok(()) corresponds to CONTINUE, and Err(FilterError::OutOfBudget) corresponds to HALT..
20
+
/// Tries to consume a given budget from the filter.
21
+
/// In the formalism from https://arxiv.org/abs/1605.08294, Ok(()) corresponds to CONTINUE, and Err(FilterError::OutOfBudget) corresponds to HALT.
0 commit comments