pub trait AlertingSub: Sized {
    // Required method
    fn alerting_sub(&self, v: &Self) -> Fallible<Self>;
}
Expand description

Fallible subtraction that returns an error if overflowing.

Avoids unrecoverable panics that could leak private information.

use opendp::traits::AlertingSub;
assert!(i8::MIN.alerting_sub(&1).is_err());

Required Methods§

source

fn alerting_sub(&self, v: &Self) -> Fallible<Self>

Proof Definition

For any self and v of type Self, returns Ok(self - v) if the result does not overflow, else Err(e)

Implementations on Foreign Types§

source§

impl AlertingSub for isize

source§

fn alerting_sub(&self, v: &Self) -> Fallible<Self>

source§

impl AlertingSub for i64

source§

fn alerting_sub(&self, v: &Self) -> Fallible<Self>

source§

impl AlertingSub for u32

source§

fn alerting_sub(&self, v: &Self) -> Fallible<Self>

source§

impl AlertingSub for u16

source§

fn alerting_sub(&self, v: &Self) -> Fallible<Self>

source§

impl AlertingSub for i16

source§

fn alerting_sub(&self, v: &Self) -> Fallible<Self>

source§

impl AlertingSub for u64

source§

fn alerting_sub(&self, v: &Self) -> Fallible<Self>

source§

impl AlertingSub for u8

source§

fn alerting_sub(&self, v: &Self) -> Fallible<Self>

source§

impl AlertingSub for i128

source§

fn alerting_sub(&self, v: &Self) -> Fallible<Self>

source§

impl AlertingSub for f64

source§

fn alerting_sub(&self, v: &Self) -> Fallible<Self>

source§

impl AlertingSub for usize

source§

fn alerting_sub(&self, v: &Self) -> Fallible<Self>

source§

impl AlertingSub for u128

source§

fn alerting_sub(&self, v: &Self) -> Fallible<Self>

source§

impl AlertingSub for i8

source§

fn alerting_sub(&self, v: &Self) -> Fallible<Self>

source§

impl AlertingSub for i32

source§

fn alerting_sub(&self, v: &Self) -> Fallible<Self>

source§

impl AlertingSub for f32

source§

fn alerting_sub(&self, v: &Self) -> Fallible<Self>

Implementors§