Prime16

Struct Prime16 

Source
pub struct Prime16(/* private fields */);
Expand description

A 16-bit prime number, from the set $\Bbb{P}$, also known as P16.

Can represent the first 6,542 prime numbers.

Implementations§

Source§

impl Prime16

Source

pub fn new(value: u16) -> NumeraResult<Self>

Returns a new Prime16.

§Errors

If the given value is not a prime number.

Source

pub const fn new_nth(nth: u16) -> NumeraResult<Self>

Returns the nth prime number.

§Errors

If nth is >= 6,542.

§Examples
use numera::all::*;

assert_eq![Prime16::MIN, Prime16::new_nth(0)?];
assert_eq![Prime16::from(Prime8::MAX), Prime16::new_nth(53)?];
assert_eq![Prime16::MAX, Prime16::new_nth(6_541)?];
assert![Prime16::new_nth(6_542).is_err()];
Source

pub unsafe fn new_unchecked(value: u16) -> Self

Available on crate feature not(safe) only.

Returns a new Prime16.

§Safety

The given value must be a prime number.

§Panics

Panics in debug if the given value is not a prime number.

Source

pub fn pi(&self) -> usize

Returns the number of primes upto and including the current one.

§Notation

$\pi(x)$

§Example
use numera::all::{Numbers, Prime16};

assert_eq![1, Prime16::new(2)?.pi()];
assert_eq![54, Prime16::new(251)?.pi()];
assert_eq![55, Prime16::new(257)?.pi()];
assert_eq![6_542, Prime16::new(65_521)?.pi()];

Trait Implementations§

Source§

impl Bound for Prime16

Source§

fn is_lower_bounded(&self) -> bool

Returns true if the number is lower bounded.
Source§

fn is_upper_bounded(&self) -> bool

Returns true if the number is upper bounded.
Source§

fn lower_bound(&self) -> Option<Self>

Returns the lower bound, if any.
Source§

fn upper_bound(&self) -> Option<Self>

Returns the upper bound, if any.
Source§

impl Clone for Prime16

Source§

fn clone(&self) -> Prime16

Returns a duplicate 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 ConstLowerBounded for Prime16

Source§

const MIN: Self

The smallest value that can be represented with this type.
Source§

impl ConstUpperBounded for Prime16

Source§

const MAX: Self

The largest 16-bit prime equals u16::MAX - 14.

Source§

impl Count for Prime16

Source§

fn is_countable(&self) -> bool

Returns true if the number is countable.
Source§

fn is_uncountable(&self) -> bool

Returns false if the number is countable.
Source§

impl Countable for Prime16

Source§

fn next(&self) -> NumeraResult<Self>

Returns the next prime.

§Examples
use numera::all::{Countable, Number, Prime16};
assert_eq![Prime16::from_inner_repr(5)?.next()?, Prime16::from_inner_repr(7)?];
assert_eq![Prime16::from_inner_repr(251)?.next()?, Prime16::from_inner_repr(257)?];
assert_eq![Prime16::from_inner_repr(257)?.next()?, Prime16::from_inner_repr(263)?];
assert_eq![Prime16::from_inner_repr(65_519)?.next()?, Prime16::from_inner_repr(65_521)?];
assert![Prime16::from_inner_repr(65_521)?.next().is_err()];
Source§

fn previous(&self) -> NumeraResult<Self>

Returns the previous prime.

§Examples
use numera::all::{Countable, Number, Prime16};
assert_eq![Prime16::from_inner_repr(7)?.previous()?, Prime16::from_inner_repr(5)?];
assert_eq![Prime16::from_inner_repr(251)?.previous()?, Prime16::from_inner_repr(241)?];
assert_eq![Prime16::from_inner_repr(257)?.previous()?, Prime16::from_inner_repr(251)?];
assert_eq![Prime16::from_inner_repr(65_521)?.previous()?, Prime16::from_inner_repr(65_519)?];
assert![Prime16::from_inner_repr(2)?.previous().is_err()];
Source§

impl Debug for Prime16

Source§

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

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

impl Display for Prime16

Source§

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

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

impl From<&Prime16> for Integer128

Source§

fn from(f: &Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&Prime16> for Integer32

Source§

fn from(f: &Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&Prime16> for Integer64

Source§

fn from(f: &Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&Prime16> for IntegerBig

Available on crate feature dashu-int only.
Source§

fn from(f: &Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&Prime16> for NonNegativeInteger128

Source§

fn from(f: &Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&Prime16> for NonNegativeInteger16

Source§

fn from(f: &Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&Prime16> for NonNegativeInteger32

Source§

fn from(f: &Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&Prime16> for NonNegativeInteger64

Source§

fn from(f: &Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&Prime16> for NonZeroInteger128

Source§

fn from(f: &Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&Prime16> for NonZeroInteger32

Source§

fn from(f: &Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&Prime16> for NonZeroInteger64

Source§

fn from(f: &Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&Prime16> for PositiveInteger128

Source§

fn from(f: &Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&Prime16> for PositiveInteger16

Source§

fn from(f: &Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&Prime16> for PositiveInteger32

Source§

fn from(f: &Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&Prime16> for PositiveInteger64

Source§

fn from(f: &Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&mut Prime16> for Integer128

Source§

fn from(f: &mut Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&mut Prime16> for Integer32

Source§

fn from(f: &mut Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&mut Prime16> for Integer64

Source§

fn from(f: &mut Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&mut Prime16> for IntegerBig

Available on crate feature dashu-int only.
Source§

fn from(f: &mut Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&mut Prime16> for NonNegativeInteger128

Source§

fn from(f: &mut Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&mut Prime16> for NonNegativeInteger16

Source§

fn from(f: &mut Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&mut Prime16> for NonNegativeInteger32

Source§

fn from(f: &mut Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&mut Prime16> for NonNegativeInteger64

Source§

fn from(f: &mut Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&mut Prime16> for NonZeroInteger128

Source§

fn from(f: &mut Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&mut Prime16> for NonZeroInteger32

Source§

fn from(f: &mut Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&mut Prime16> for NonZeroInteger64

Source§

fn from(f: &mut Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&mut Prime16> for PositiveInteger128

Source§

fn from(f: &mut Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&mut Prime16> for PositiveInteger16

Source§

fn from(f: &mut Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&mut Prime16> for PositiveInteger32

Source§

fn from(f: &mut Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<&mut Prime16> for PositiveInteger64

Source§

fn from(f: &mut Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<Prime16> for Integer128

Source§

fn from(f: Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<Prime16> for Integer32

Source§

fn from(f: Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<Prime16> for Integer64

Source§

fn from(f: Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<Prime16> for IntegerBig

Available on crate feature dashu-int only.
Source§

fn from(f: Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<Prime16> for NonNegativeInteger128

Source§

fn from(f: Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<Prime16> for NonNegativeInteger16

Source§

fn from(f: Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<Prime16> for NonNegativeInteger32

Source§

fn from(f: Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<Prime16> for NonNegativeInteger64

Source§

fn from(f: Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<Prime16> for NonZeroInteger128

Source§

fn from(f: Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<Prime16> for NonZeroInteger32

Source§

fn from(f: Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<Prime16> for NonZeroInteger64

Source§

fn from(f: Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<Prime16> for PositiveInteger128

Source§

fn from(f: Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<Prime16> for PositiveInteger16

Source§

fn from(f: Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<Prime16> for PositiveInteger32

Source§

fn from(f: Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<Prime16> for PositiveInteger64

Source§

fn from(f: Prime16) -> Self

Converts to this type from the input type.
Source§

impl From<Prime16> for Prime128

Source§

fn from(p: Prime16) -> Prime128

Converts to this type from the input type.
Source§

impl From<Prime16> for Prime32

Source§

fn from(p: Prime16) -> Prime32

Converts to this type from the input type.
Source§

impl From<Prime16> for Prime64

Source§

fn from(p: Prime16) -> Prime64

Converts to this type from the input type.
Source§

impl From<Prime16> for Primes

Source§

fn from(p: Prime16) -> Primes

Converts to this type from the input type.
Source§

impl From<Prime16> for i128

Source§

fn from(p: Prime16) -> i128

Converts to this type from the input type.
Source§

impl From<Prime16> for i32

Source§

fn from(p: Prime16) -> i32

Converts to this type from the input type.
Source§

impl From<Prime16> for i64

Source§

fn from(p: Prime16) -> i64

Converts to this type from the input type.
Source§

impl From<Prime16> for u128

Source§

fn from(p: Prime16) -> u128

Converts to this type from the input type.
Source§

impl From<Prime16> for u16

Source§

fn from(p: Prime16) -> u16

Converts to this type from the input type.
Source§

impl From<Prime16> for u32

Source§

fn from(p: Prime16) -> u32

Converts to this type from the input type.
Source§

impl From<Prime16> for u64

Source§

fn from(p: Prime16) -> u64

Converts to this type from the input type.
Source§

impl From<Prime16> for usize

Source§

fn from(p: Prime16) -> usize

Converts to this type from the input type.
Source§

impl From<Prime8> for Prime16

Source§

fn from(p: Prime8) -> Prime16

Converts to this type from the input type.
Source§

impl Hash for Prime16

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ident for Prime16

Source§

fn can_zero(&self) -> bool

Returns true if the number can represent 0, the additive identity. Read more
Source§

fn can_one(&self) -> bool

Returns true if the number can represent 1, the multiplicative identity. Read more
Source§

fn can_neg_one(&self) -> bool

Returns true if the number can represent -1, the additive inverse of the multiplicative identity. Read more
Source§

fn is_zero(&self) -> bool

Returns true if the current value is 0. the additive identity.
Source§

fn is_one(&self) -> bool

Returns true if the current value is 1, the multiplicative identity.
Source§

fn is_neg_one(&self) -> bool

Returns true if the current value is -1, the additive inverse of the multiplicative identity.
Source§

impl LowerBounded for Prime16

Source§

fn new_min() -> Self

The smallest value that can be represented with this type.
Source§

impl Number for Prime16

Source§

type InnerRepr = u16

The inner primitive representation of the number. Read more
Source§

type InnermostRepr = u16

The innermost primitive representation of the number. Read more
Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Forms a new number from its given inner representation. Read more
Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Forms a new number from its given inner representation. Read more
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Forms a new number from its innermost representation. Read more
Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Forms a new number from its innermost representation. Read more
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Deconstructs the number to its inner representation.
Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Deconstructs the number to its innermost representation.
Source§

fn try_from_inner_repr(inner: impl Into<Self::InnerRepr>) -> NumeraResult<Self>
where Self: Sized,

Forms a new number from its converted given inner representation. Read more
Source§

impl Ord for Prime16

Source§

fn cmp(&self, other: &Prime16) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Prime16

Source§

fn eq(&self, other: &Prime16) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Prime16

Source§

fn partial_cmp(&self, other: &Prime16) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Prime for Prime16

Source§

fn get_nth(nth: usize) -> Option<Self>

Returns the nth prime, or None if out of bounds.
Source§

fn is_bell(&self) -> bool

Returns true if this is a Bell prime. Read more
Source§

impl Sign for Prime16

Source§

fn can_positive(&self) -> bool

Returns true if the type can represent positive numbers.
Source§

fn can_negative(&self) -> bool

Returns true if the type can represent negative numbers.
Source§

fn is_positive(&self) -> bool

Returns true if the value is positive (> 0).
Source§

fn is_negative(&self) -> bool

Returns true if the value is negative (< 0).
Source§

impl TryFrom<&Prime16> for Integer16

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(f: &Prime16) -> NumeraResult<Integer16>

Performs the conversion.
Source§

impl TryFrom<&Prime16> for Integer8

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(f: &Prime16) -> NumeraResult<Integer8>

Performs the conversion.
Source§

impl TryFrom<&Prime16> for NegativeInteger128

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: &Prime16) -> NumeraResult<NegativeInteger128>

Performs the conversion.
Source§

impl TryFrom<&Prime16> for NegativeInteger16

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: &Prime16) -> NumeraResult<NegativeInteger16>

Performs the conversion.
Source§

impl TryFrom<&Prime16> for NegativeInteger32

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: &Prime16) -> NumeraResult<NegativeInteger32>

Performs the conversion.
Source§

impl TryFrom<&Prime16> for NegativeInteger64

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: &Prime16) -> NumeraResult<NegativeInteger64>

Performs the conversion.
Source§

impl TryFrom<&Prime16> for NegativeInteger8

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: &Prime16) -> NumeraResult<NegativeInteger8>

Performs the conversion.
Source§

impl TryFrom<&Prime16> for NonNegativeInteger8

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(f: &Prime16) -> NumeraResult<NonNegativeInteger8>

Performs the conversion.
Source§

impl TryFrom<&Prime16> for NonPositiveInteger128

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: &Prime16) -> NumeraResult<NonPositiveInteger128>

Performs the conversion.
Source§

impl TryFrom<&Prime16> for NonPositiveInteger16

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: &Prime16) -> NumeraResult<NonPositiveInteger16>

Performs the conversion.
Source§

impl TryFrom<&Prime16> for NonPositiveInteger32

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: &Prime16) -> NumeraResult<NonPositiveInteger32>

Performs the conversion.
Source§

impl TryFrom<&Prime16> for NonPositiveInteger64

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: &Prime16) -> NumeraResult<NonPositiveInteger64>

Performs the conversion.
Source§

impl TryFrom<&Prime16> for NonPositiveInteger8

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: &Prime16) -> NumeraResult<NonPositiveInteger8>

Performs the conversion.
Source§

impl TryFrom<&Prime16> for NonZeroInteger16

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(f: &Prime16) -> NumeraResult<NonZeroInteger16>

Performs the conversion.
Source§

impl TryFrom<&Prime16> for NonZeroInteger8

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(f: &Prime16) -> NumeraResult<NonZeroInteger8>

Performs the conversion.
Source§

impl TryFrom<&Prime16> for PositiveInteger8

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(f: &Prime16) -> NumeraResult<PositiveInteger8>

Performs the conversion.
Source§

impl TryFrom<&mut Prime16> for Integer16

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(f: &mut Prime16) -> NumeraResult<Integer16>

Performs the conversion.
Source§

impl TryFrom<&mut Prime16> for Integer8

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(f: &mut Prime16) -> NumeraResult<Integer8>

Performs the conversion.
Source§

impl TryFrom<&mut Prime16> for NegativeInteger128

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: &mut Prime16) -> NumeraResult<NegativeInteger128>

Performs the conversion.
Source§

impl TryFrom<&mut Prime16> for NegativeInteger16

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: &mut Prime16) -> NumeraResult<NegativeInteger16>

Performs the conversion.
Source§

impl TryFrom<&mut Prime16> for NegativeInteger32

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: &mut Prime16) -> NumeraResult<NegativeInteger32>

Performs the conversion.
Source§

impl TryFrom<&mut Prime16> for NegativeInteger64

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: &mut Prime16) -> NumeraResult<NegativeInteger64>

Performs the conversion.
Source§

impl TryFrom<&mut Prime16> for NegativeInteger8

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: &mut Prime16) -> NumeraResult<NegativeInteger8>

Performs the conversion.
Source§

impl TryFrom<&mut Prime16> for NonNegativeInteger8

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(f: &mut Prime16) -> NumeraResult<NonNegativeInteger8>

Performs the conversion.
Source§

impl TryFrom<&mut Prime16> for NonPositiveInteger128

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: &mut Prime16) -> NumeraResult<NonPositiveInteger128>

Performs the conversion.
Source§

impl TryFrom<&mut Prime16> for NonPositiveInteger16

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: &mut Prime16) -> NumeraResult<NonPositiveInteger16>

Performs the conversion.
Source§

impl TryFrom<&mut Prime16> for NonPositiveInteger32

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: &mut Prime16) -> NumeraResult<NonPositiveInteger32>

Performs the conversion.
Source§

impl TryFrom<&mut Prime16> for NonPositiveInteger64

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: &mut Prime16) -> NumeraResult<NonPositiveInteger64>

Performs the conversion.
Source§

impl TryFrom<&mut Prime16> for NonPositiveInteger8

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: &mut Prime16) -> NumeraResult<NonPositiveInteger8>

Performs the conversion.
Source§

impl TryFrom<&mut Prime16> for NonZeroInteger16

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(f: &mut Prime16) -> NumeraResult<NonZeroInteger16>

Performs the conversion.
Source§

impl TryFrom<&mut Prime16> for NonZeroInteger8

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(f: &mut Prime16) -> NumeraResult<NonZeroInteger8>

Performs the conversion.
Source§

impl TryFrom<&mut Prime16> for PositiveInteger8

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(f: &mut Prime16) -> NumeraResult<PositiveInteger8>

Performs the conversion.
Source§

impl TryFrom<Prime128> for Prime16

Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(value: Prime128) -> NumeraResult<Prime16>

Performs the conversion.
Source§

impl TryFrom<Prime16> for Integer16

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(f: Prime16) -> NumeraResult<Integer16>

Performs the conversion.
Source§

impl TryFrom<Prime16> for Integer8

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(f: Prime16) -> NumeraResult<Integer8>

Performs the conversion.
Source§

impl TryFrom<Prime16> for NegativeInteger128

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: Prime16) -> NumeraResult<NegativeInteger128>

Performs the conversion.
Source§

impl TryFrom<Prime16> for NegativeInteger16

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: Prime16) -> NumeraResult<NegativeInteger16>

Performs the conversion.
Source§

impl TryFrom<Prime16> for NegativeInteger32

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: Prime16) -> NumeraResult<NegativeInteger32>

Performs the conversion.
Source§

impl TryFrom<Prime16> for NegativeInteger64

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: Prime16) -> NumeraResult<NegativeInteger64>

Performs the conversion.
Source§

impl TryFrom<Prime16> for NegativeInteger8

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: Prime16) -> NumeraResult<NegativeInteger8>

Performs the conversion.
Source§

impl TryFrom<Prime16> for NonNegativeInteger8

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(f: Prime16) -> NumeraResult<NonNegativeInteger8>

Performs the conversion.
Source§

impl TryFrom<Prime16> for NonPositiveInteger128

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: Prime16) -> NumeraResult<NonPositiveInteger128>

Performs the conversion.
Source§

impl TryFrom<Prime16> for NonPositiveInteger16

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: Prime16) -> NumeraResult<NonPositiveInteger16>

Performs the conversion.
Source§

impl TryFrom<Prime16> for NonPositiveInteger32

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: Prime16) -> NumeraResult<NonPositiveInteger32>

Performs the conversion.
Source§

impl TryFrom<Prime16> for NonPositiveInteger64

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: Prime16) -> NumeraResult<NonPositiveInteger64>

Performs the conversion.
Source§

impl TryFrom<Prime16> for NonPositiveInteger8

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(_f: Prime16) -> NumeraResult<NonPositiveInteger8>

Performs the conversion.
Source§

impl TryFrom<Prime16> for NonZeroInteger16

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(f: Prime16) -> NumeraResult<NonZeroInteger16>

Performs the conversion.
Source§

impl TryFrom<Prime16> for NonZeroInteger8

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(f: Prime16) -> NumeraResult<NonZeroInteger8>

Performs the conversion.
Source§

impl TryFrom<Prime16> for PositiveInteger8

Available on crate feature try_from only.
Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(f: Prime16) -> NumeraResult<PositiveInteger8>

Performs the conversion.
Source§

impl TryFrom<Prime16> for Prime8

Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(value: Prime16) -> NumeraResult<Prime8>

Performs the conversion.
Source§

impl TryFrom<Prime16> for i16

Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(p: Prime16) -> NumeraResult<i16>

Performs the conversion.
Source§

impl TryFrom<Prime16> for i8

Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(p: Prime16) -> NumeraResult<i8>

Performs the conversion.
Source§

impl TryFrom<Prime16> for isize

Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(p: Prime16) -> NumeraResult<isize>

Performs the conversion.
Source§

impl TryFrom<Prime16> for u8

Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(p: Prime16) -> NumeraResult<u8>

Performs the conversion.
Source§

impl TryFrom<Prime32> for Prime16

Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(value: Prime32) -> NumeraResult<Prime16>

Performs the conversion.
Source§

impl TryFrom<Prime64> for Prime16

Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(value: Prime64) -> NumeraResult<Prime16>

Performs the conversion.
Source§

impl TryFrom<i128> for Prime16

Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(p: i128) -> NumeraResult<Prime16>

Performs the conversion.
Source§

impl TryFrom<i16> for Prime16

Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(p: i16) -> NumeraResult<Prime16>

Performs the conversion.
Source§

impl TryFrom<i32> for Prime16

Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(p: i32) -> NumeraResult<Prime16>

Performs the conversion.
Source§

impl TryFrom<i64> for Prime16

Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(p: i64) -> NumeraResult<Prime16>

Performs the conversion.
Source§

impl TryFrom<i8> for Prime16

Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(p: i8) -> NumeraResult<Prime16>

Performs the conversion.
Source§

impl TryFrom<isize> for Prime16

Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(p: isize) -> NumeraResult<Prime16>

Performs the conversion.
Source§

impl TryFrom<u128> for Prime16

Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(p: u128) -> NumeraResult<Prime16>

Performs the conversion.
Source§

impl TryFrom<u16> for Prime16

Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(p: u16) -> NumeraResult<Prime16>

Performs the conversion.
Source§

impl TryFrom<u32> for Prime16

Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(p: u32) -> NumeraResult<Prime16>

Performs the conversion.
Source§

impl TryFrom<u64> for Prime16

Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(p: u64) -> NumeraResult<Prime16>

Performs the conversion.
Source§

impl TryFrom<usize> for Prime16

Source§

type Error = NumeraErrors

The type returned in the event of a conversion error.
Source§

fn try_from(p: usize) -> NumeraResult<Prime16>

Performs the conversion.
Source§

impl UpperBounded for Prime16

Source§

fn new_max() -> Self

The largest value that can be represented with this type.
Source§

impl Copy for Prime16

Source§

impl Eq for Prime16

Source§

impl NonNegative for Prime16

Source§

impl NonOne for Prime16

Source§

impl NonZero for Prime16

Source§

impl Positive for Prime16

Source§

impl StructuralPartialEq for Prime16

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Also for T

Source§

fn also_mut<F>(self, f: F) -> Self
where F: FnOnce(&mut Self),

Applies a function which takes the parameter by exclusive reference, and then returns the (possibly) modified owned value. Read more
Source§

fn also_ref<F>(self, f: F) -> Self
where F: FnOnce(&Self),

Applies a function which takes the parameter by shared reference, and then returns the (possibly) modified owned value. Read more
Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T, Res> Apply<Res> for T
where T: ?Sized,

Source§

fn apply<F>(self, f: F) -> Res
where F: FnOnce(Self) -> Res, Self: Sized,

Apply a function which takes the parameter by value.
Source§

fn apply_ref<F>(&self, f: F) -> Res
where F: FnOnce(&Self) -> Res,

Apply a function which takes the parameter by shared reference.
Source§

fn apply_mut<F>(&mut self, f: F) -> Res
where F: FnOnce(&mut Self) -> Res,

Apply a function which takes the parameter by exclusive reference.
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

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

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> Bounded for T

Source§

impl<T> ConstBounded for T

Source§

impl<T> NonNegOne for T
where T: Ident + NonNegative,

Source§

impl<T> Unsigned for T
where T: Positive + NonNegative,