[][src]Crate modtype

This crate provides:

Requirements

  • The inner value is u8, u16, u32, u64, u128, or usize.
  • The inner value and the modulus are of a same type.
  • The modulus is immutable.
  • The inner value is always smaller than the modulus.
    • If the modular arithmetic type implements One, The modulus is larger than 1.
  • If the modular arithmetic type implements Div, the modulus is a prime.

Attributes

Struct

Name Format Optional
modulus modulus = #Lit where #Lit is converted/parsed to an Expr No
std std = #LitStr where #LitStr is parsed to a Path Yes (default = ::std)
num_traits num_traits = #LitStr where #LitStr is parsed to a Path Yes (default = ::num::traits)
num_integer num_integer = #LitStr where #LitStr is parsed to a Path Yes (default = ::num::integer)
num_bigint num_bigint = #LitStr where #LitStr is parsed to a Path Yes (default = ::num::bigint)
no_impl_for_ref no_impl_for_ref Yes

Field

Name Format Optional
value value No

ConstValue

Struct

Name Format Optional
const_value const_value = #LitInt where #LitInt has a suffix No

Re-exports

pub use modtype_derive::ConstValue;
pub use modtype_derive::From;
pub use modtype_derive::Into;
pub use modtype_derive::FromStr;
pub use modtype_derive::Display;
pub use modtype_derive::DebugTransparent;
pub use modtype_derive::DebugTransparent as Debug;
pub use modtype_derive::Deref;
pub use modtype_derive::Neg;
pub use modtype_derive::Add;
pub use modtype_derive::AddAssign;
pub use modtype_derive::Sub;
pub use modtype_derive::SubAssign;
pub use modtype_derive::Mul;
pub use modtype_derive::MulAssign;
pub use modtype_derive::Div;
pub use modtype_derive::DivAssign;
pub use modtype_derive::Rem;
pub use modtype_derive::RemAssign;
pub use modtype_derive::Zero;
pub use modtype_derive::One;
pub use modtype_derive::Num;
pub use modtype_derive::Bounded;
pub use modtype_derive::CheckedAdd;
pub use modtype_derive::CheckedSub;
pub use modtype_derive::CheckedMul;
pub use modtype_derive::CheckedDiv;
pub use modtype_derive::CheckedRem;
pub use modtype_derive::CheckedNeg;
pub use modtype_derive::Inv;
pub use modtype_derive::Unsigned;
pub use modtype_derive::FromPrimitive;
pub use modtype_derive::ToPrimitive;
pub use modtype_derive::Pow_u8;
pub use modtype_derive::Pow_u16;
pub use modtype_derive::Pow_u32;
pub use modtype_derive::Pow_usize;
pub use modtype_derive::Integer;
pub use modtype_derive::ToBigUint;
pub use modtype_derive::ToBigInt;
pub use modtype_derive::new;
pub use modtype_derive::get;

Modules

preset

Preset types.

Traits

ConstValue

A trait that has one associated constant value.