Struct secret_integers::I16

source ·
pub struct I16(pub i16);

Tuple Fields§

§0: i16

Implementations§

source§

impl I16

source

pub fn classify<T: Into<i16>>(x: T) -> Self

source

pub fn declassify(self) -> i16

Warning: use with caution, breaks the constant-time guarantee.

source

pub fn zero() -> Self

source

pub fn one() -> Self

source

pub fn ones() -> Self

source

pub fn from_le_bytes(bytes: &[U8]) -> Vec<I16>

source

pub fn to_le_bytes(ints: &[I16]) -> Vec<U8>

source

pub fn from_be_bytes(bytes: &[U8]) -> Vec<I16>

source

pub fn to_be_bytes(ints: &[I16]) -> Vec<U8>

source

pub fn max_value() -> I16

source§

impl I16

source

pub fn checked_add(self, rhs: Self) -> Self

Warning: panics when overflow.

source§

impl I16

source

pub fn checked_sub(self, rhs: Self) -> Self

Warning: panics when overflow.

source§

impl I16

source

pub fn checked_mul(self, rhs: Self) -> Self

Warning: panics when overflow.

source§

impl I16

source

pub fn rotate_left(self, rotval: usize) -> Self

source

pub fn rotate_right(self, rotval: usize) -> Self

source§

impl I16

source

pub fn comp_eq(self, rhs: Self) -> Self

source

pub fn comp_ne(self, rhs: Self) -> Self

Produces a new integer which is all ones if the first argument is different from the second argument, and all zeroes otherwise.

source

pub fn comp_gte(self, rhs: Self) -> Self

Produces a new integer which is all ones if the first argument is greater than or equal to the second argument, and all zeroes otherwise. With inspiration from

source

pub fn comp_gt(self, rhs: Self) -> Self

Produces a new integer which is all ones if the first argument is strictly greater than the second argument, and all zeroes otherwise.

source

pub fn comp_lte(self, rhs: Self) -> Self

Produces a new integer which is all ones if the first argument is less than or equal to the second argument, and all zeroes otherwise.

source

pub fn comp_lt(self, rhs: Self) -> Self

Produces a new integer which is all ones if the first argument is strictly less than the second argument, and all zeroes otherwise.

Trait Implementations§

source§

impl Add<I16> for I16

Warning: has wrapping semantics.

§

type Output = I16

The resulting type after applying the + operator.
source§

fn add(self, rhs: Self) -> Self

Performs the + operation. Read more
source§

impl AddAssign<I16> for I16

Warning: has wrapping semantics.

source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
source§

impl BitAnd<I16> for I16

§

type Output = I16

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: Self) -> Self

Performs the & operation. Read more
source§

impl BitAndAssign<I16> for I16

source§

fn bitand_assign(&mut self, rhs: Self)

Performs the &= operation. Read more
source§

impl BitOr<I16> for I16

§

type Output = I16

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: Self) -> Self

Performs the | operation. Read more
source§

impl BitOrAssign<I16> for I16

source§

fn bitor_assign(&mut self, rhs: Self)

Performs the |= operation. Read more
source§

impl BitXor<I16> for I16

§

type Output = I16

The resulting type after applying the ^ operator.
source§

fn bitxor(self, rhs: Self) -> Self

Performs the ^ operation. Read more
source§

impl BitXorAssign<I16> for I16

source§

fn bitxor_assign(&mut self, rhs: Self)

Performs the ^= operation. Read more
source§

impl Clone for I16

source§

fn clone(&self) -> I16

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for I16

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for I16

source§

fn default() -> I16

Returns the “default value” for a type. Read more
source§

impl Display for I16

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<I128> for I16

Warning: wrapping semantics.

source§

fn from(x: I128) -> I16

Converts to this type from the input type.
source§

impl From<I16> for I128

source§

fn from(x: I16) -> I128

Converts to this type from the input type.
source§

impl From<I16> for I32

source§

fn from(x: I16) -> I32

Converts to this type from the input type.
source§

impl From<I16> for I64

source§

fn from(x: I16) -> I64

Converts to this type from the input type.
source§

impl From<I16> for I8

Warning: wrapping semantics.

source§

fn from(x: I16) -> I8

Converts to this type from the input type.
source§

impl From<I16> for U16

source§

fn from(x: I16) -> U16

Converts to this type from the input type.
source§

impl From<I32> for I16

Warning: wrapping semantics.

source§

fn from(x: I32) -> I16

Converts to this type from the input type.
source§

impl From<I64> for I16

Warning: wrapping semantics.

source§

fn from(x: I64) -> I16

Converts to this type from the input type.
source§

impl From<I8> for I16

source§

fn from(x: I8) -> I16

Converts to this type from the input type.
source§

impl From<U16> for I16

Warning: wrapping semantics.

source§

fn from(x: U16) -> I16

Converts to this type from the input type.
source§

impl From<i16> for I16

source§

fn from(x: i16) -> Self

Converts to this type from the input type.
source§

impl LowerHex for I16

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Mul<I16> for I16

Warning: has wrapping semantics.

§

type Output = I16

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Self) -> Self

Performs the * operation. Read more
source§

impl MulAssign<I16> for I16

Warning: has wrapping semantics.

source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
source§

impl Neg for I16

§

type Output = I16

The resulting type after applying the - operator.
source§

fn neg(self) -> Self

Performs the unary - operation. Read more
source§

impl Not for I16

§

type Output = I16

The resulting type after applying the ! operator.
source§

fn not(self) -> Self

Performs the unary ! operation. Read more
source§

impl Shl<usize> for I16

§

type Output = I16

The resulting type after applying the << operator.
source§

fn shl(self, rhs: usize) -> Self

Performs the << operation. Read more
source§

impl ShlAssign<usize> for I16

source§

fn shl_assign(&mut self, rhs: usize)

Performs the <<= operation. Read more
source§

impl Shr<usize> for I16

§

type Output = I16

The resulting type after applying the >> operator.
source§

fn shr(self, rhs: usize) -> Self

Performs the >> operation. Read more
source§

impl ShrAssign<usize> for I16

source§

fn shr_assign(&mut self, rhs: usize)

Performs the >>= operation. Read more
source§

impl Sub<I16> for I16

Warning: has wrapping semantics.

§

type Output = I16

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Self) -> Self

Performs the - operation. Read more
source§

impl SubAssign<I16> for I16

Warning: has wrapping semantics.

source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
source§

impl Copy for I16

Auto Trait Implementations§

§

impl RefUnwindSafe for I16

§

impl Send for I16

§

impl Sync for I16

§

impl Unpin for I16

§

impl UnwindSafe for I16

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.