Struct opendp::core::Transformation
source · pub struct Transformation<DI: Domain, DO: Domain, MI: Metric, MO: Metric> {
pub input_domain: DI,
pub output_domain: DO,
pub function: Function<DI::Carrier, DO::Carrier>,
pub input_metric: MI,
pub output_metric: MO,
pub stability_map: StabilityMap<MI, MO>,
}
Expand description
A data transformation with certain stability characteristics.
The trait bounds provided by the Rust type system guarantee that:
input_domain
andoutput_domain
are valid domainsinput_metric
andoutput_metric
are valid metrics
It is, however, left to constructor functions to prove that:
- metrics are compatible with domains
function
is a mapping from the input domain to the output domainstability_map
is a mapping from the input metric to the output metric
Fields§
§input_domain: DI
§output_domain: DO
§function: Function<DI::Carrier, DO::Carrier>
§input_metric: MI
§output_metric: MO
§stability_map: StabilityMap<MI, MO>
Implementations§
source§impl<DI: 'static + Domain, DO: 'static + Domain, MI: 'static + Metric, MO: 'static + Metric> Transformation<DI, DO, MI, MO>where
DI::Carrier: 'static,
DO::Carrier: 'static,
MI::Distance: 'static,
MO::Distance: 'static,
(DI, MI): MetricSpace,
(DO, MO): MetricSpace,
impl<DI: 'static + Domain, DO: 'static + Domain, MI: 'static + Metric, MO: 'static + Metric> Transformation<DI, DO, MI, MO>where
DI::Carrier: 'static,
DO::Carrier: 'static,
MI::Distance: 'static,
MO::Distance: 'static,
(DI, MI): MetricSpace,
(DO, MO): MetricSpace,
pub fn into_any(self) -> AnyTransformation
source§impl<DI: Domain, DO: Domain, MI: Metric, MO: Metric> Transformation<DI, DO, MI, MO>
impl<DI: Domain, DO: Domain, MI: Metric, MO: Metric> Transformation<DI, DO, MI, MO>
pub fn new( input_domain: DI, output_domain: DO, function: Function<DI::Carrier, DO::Carrier>, input_metric: MI, output_metric: MO, stability_map: StabilityMap<MI, MO>, ) -> Fallible<Self>
pub(crate) fn with_map<MI2: Metric, MO2: Metric>( &self, input_metric: MI2, output_metric: MO2, privacy_map: StabilityMap<MI2, MO2>, ) -> Fallible<Transformation<DI, DO, MI2, MO2>>
pub fn input_space(&self) -> (DI, MI)
pub fn output_space(&self) -> (DO, MO)
Trait Implementations§
source§impl<DI: Clone + Domain, DO: Clone + Domain, MI: Clone + Metric, MO: Clone + Metric> Clone for Transformation<DI, DO, MI, MO>
impl<DI: Clone + Domain, DO: Clone + Domain, MI: Clone + Metric, MO: Clone + Metric> Clone for Transformation<DI, DO, MI, MO>
source§fn clone(&self) -> Transformation<DI, DO, MI, MO>
fn clone(&self) -> Transformation<DI, DO, MI, MO>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<DI, DX, TO, MI, MX, MO> Shr<Measurement<DX, TO, MX, MO>> for Transformation<DI, DX, MI, MX>where
DI: 'static + Domain,
DX: 'static + Domain,
TO: 'static,
MI: 'static + Metric,
MX: 'static + Metric,
MO: 'static + Measure,
(DI, MI): MetricSpace,
(DX, MX): MetricSpace,
impl<DI, DX, TO, MI, MX, MO> Shr<Measurement<DX, TO, MX, MO>> for Transformation<DI, DX, MI, MX>where
DI: 'static + Domain,
DX: 'static + Domain,
TO: 'static,
MI: 'static + Metric,
MX: 'static + Metric,
MO: 'static + Measure,
(DI, MI): MetricSpace,
(DX, MX): MetricSpace,
source§impl<DI, DX, TO, MI, MX, MO> Shr<PartialMeasurement<DX, TO, MX, MO>> for Transformation<DI, DX, MI, MX>where
DI: 'static + Domain,
DX: 'static + Domain,
TO: 'static,
MI: 'static + Metric,
MX: 'static + Metric,
MO: 'static + Measure,
(DI, MI): MetricSpace,
(DX, MX): MetricSpace,
impl<DI, DX, TO, MI, MX, MO> Shr<PartialMeasurement<DX, TO, MX, MO>> for Transformation<DI, DX, MI, MX>where
DI: 'static + Domain,
DX: 'static + Domain,
TO: 'static,
MI: 'static + Metric,
MX: 'static + Metric,
MO: 'static + Measure,
(DI, MI): MetricSpace,
(DX, MX): MetricSpace,
source§impl<DI, DX, DO, MI, MX, MO> Shr<PartialTransformation<DX, DO, MX, MO>> for Transformation<DI, DX, MI, MX>where
DI: 'static + Domain,
DX: 'static + Domain,
DO: 'static + Domain,
MI: 'static + Metric,
MX: 'static + Metric,
MO: 'static + Metric,
(DI, MI): MetricSpace,
(DX, MX): MetricSpace,
(DO, MO): MetricSpace,
impl<DI, DX, DO, MI, MX, MO> Shr<PartialTransformation<DX, DO, MX, MO>> for Transformation<DI, DX, MI, MX>where
DI: 'static + Domain,
DX: 'static + Domain,
DO: 'static + Domain,
MI: 'static + Metric,
MX: 'static + Metric,
MO: 'static + Metric,
(DI, MI): MetricSpace,
(DX, MX): MetricSpace,
(DO, MO): MetricSpace,
source§impl<DI, DX, DO, MI, MO, MTI, MTO> Shr<Transformation<DX, DO, MTI, MTO>> for Measurement<DI, DX::Carrier, MI, MO>where
DI: 'static + Domain,
DX: 'static + Domain,
DO: 'static + Domain,
MI: 'static + Metric,
MO: 'static + Measure,
MTI: 'static + Metric,
MTO: 'static + Metric,
(DI, MI): MetricSpace,
(DX, MTI): MetricSpace,
(DO, MTO): MetricSpace,
impl<DI, DX, DO, MI, MO, MTI, MTO> Shr<Transformation<DX, DO, MTI, MTO>> for Measurement<DI, DX::Carrier, MI, MO>where
DI: 'static + Domain,
DX: 'static + Domain,
DO: 'static + Domain,
MI: 'static + Metric,
MO: 'static + Measure,
MTI: 'static + Metric,
MTO: 'static + Metric,
(DI, MI): MetricSpace,
(DX, MTI): MetricSpace,
(DO, MTO): MetricSpace,
source§impl<DI, DX, DO, MI, MO, MTI, MTO> Shr<Transformation<DX, DO, MTI, MTO>> for PartialMeasurement<DI, DX::Carrier, MI, MO>where
DI: 'static + Domain,
DX: 'static + Domain,
DO: 'static + Domain,
MI: 'static + Metric,
MO: 'static + Measure,
MTI: 'static + Metric,
MTO: 'static + Metric,
(DI, MI): MetricSpace,
(DX, MTI): MetricSpace,
(DO, MTO): MetricSpace,
impl<DI, DX, DO, MI, MO, MTI, MTO> Shr<Transformation<DX, DO, MTI, MTO>> for PartialMeasurement<DI, DX::Carrier, MI, MO>where
DI: 'static + Domain,
DX: 'static + Domain,
DO: 'static + Domain,
MI: 'static + Metric,
MO: 'static + Measure,
MTI: 'static + Metric,
MTO: 'static + Metric,
(DI, MI): MetricSpace,
(DX, MTI): MetricSpace,
(DO, MTO): MetricSpace,
source§impl<DI, DX, DO, MI, MO, MTI, MTO> Shr<Transformation<DX, DO, MTI, MTO>> for Fallible<Measurement<DI, DX::Carrier, MI, MO>>where
DI: 'static + Domain,
DX: 'static + Domain,
DO: 'static + Domain,
MI: 'static + Metric,
MO: 'static + Measure,
MTI: 'static + Metric,
MTO: 'static + Metric,
(DI, MI): MetricSpace,
(DX, MTI): MetricSpace,
(DO, MTO): MetricSpace,
impl<DI, DX, DO, MI, MO, MTI, MTO> Shr<Transformation<DX, DO, MTI, MTO>> for Fallible<Measurement<DI, DX::Carrier, MI, MO>>where
DI: 'static + Domain,
DX: 'static + Domain,
DO: 'static + Domain,
MI: 'static + Metric,
MO: 'static + Measure,
MTI: 'static + Metric,
MTO: 'static + Metric,
(DI, MI): MetricSpace,
(DX, MTI): MetricSpace,
(DO, MTO): MetricSpace,
source§impl<DI, DX, DO, MI, MX, MO> Shr<Transformation<DX, DO, MX, MO>> for PartialTransformation<DI, DX, MI, MX>where
DI: 'static + Domain,
DX: 'static + Domain,
DO: 'static + Domain,
MI: 'static + Metric,
MX: 'static + Metric,
MO: 'static + Metric,
(DI, MI): MetricSpace,
(DX, MX): MetricSpace,
(DO, MO): MetricSpace,
impl<DI, DX, DO, MI, MX, MO> Shr<Transformation<DX, DO, MX, MO>> for PartialTransformation<DI, DX, MI, MX>where
DI: 'static + Domain,
DX: 'static + Domain,
DO: 'static + Domain,
MI: 'static + Metric,
MX: 'static + Metric,
MO: 'static + Metric,
(DI, MI): MetricSpace,
(DX, MX): MetricSpace,
(DO, MO): MetricSpace,
§type Output = PartialTransformation<DI, DO, MI, MO>
type Output = PartialTransformation<DI, DO, MI, MO>
The resulting type after applying the
>>
operator.source§impl<DI, DX, DO, MI, MX, MO> Shr<Transformation<DX, DO, MX, MO>> for Fallible<Transformation<DI, DX, MI, MX>>where
DI: 'static + Domain,
DX: 'static + Domain,
DO: 'static + Domain,
MI: 'static + Metric,
MX: 'static + Metric,
MO: 'static + Metric,
(DI, MI): MetricSpace,
(DX, MX): MetricSpace,
(DO, MO): MetricSpace,
impl<DI, DX, DO, MI, MX, MO> Shr<Transformation<DX, DO, MX, MO>> for Fallible<Transformation<DI, DX, MI, MX>>where
DI: 'static + Domain,
DX: 'static + Domain,
DO: 'static + Domain,
MI: 'static + Metric,
MX: 'static + Metric,
MO: 'static + Metric,
(DI, MI): MetricSpace,
(DX, MX): MetricSpace,
(DO, MO): MetricSpace,
source§impl<DI, DX, DO, MI, MX, MO> Shr<Transformation<DX, DO, MX, MO>> for Transformation<DI, DX, MI, MX>where
DI: 'static + Domain,
DX: 'static + Domain,
DO: 'static + Domain,
MI: 'static + Metric,
MX: 'static + Metric,
MO: 'static + Metric,
(DI, MI): MetricSpace,
(DX, MX): MetricSpace,
(DO, MO): MetricSpace,
impl<DI, DX, DO, MI, MX, MO> Shr<Transformation<DX, DO, MX, MO>> for Transformation<DI, DX, MI, MX>where
DI: 'static + Domain,
DX: 'static + Domain,
DO: 'static + Domain,
MI: 'static + Metric,
MX: 'static + Metric,
MO: 'static + Metric,
(DI, MI): MetricSpace,
(DX, MX): MetricSpace,
(DO, MO): MetricSpace,
Auto Trait Implementations§
impl<DI, DO, MI, MO> Freeze for Transformation<DI, DO, MI, MO>
impl<DI, DO, MI, MO> !RefUnwindSafe for Transformation<DI, DO, MI, MO>
impl<DI, DO, MI, MO> Send for Transformation<DI, DO, MI, MO>
impl<DI, DO, MI, MO> Sync for Transformation<DI, DO, MI, MO>
impl<DI, DO, MI, MO> Unpin for Transformation<DI, DO, MI, MO>
impl<DI, DO, MI, MO> !UnwindSafe for Transformation<DI, DO, MI, MO>
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
Mutably borrows from an owned value. Read more
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.