Struct adapter::primitives::BigNum
pub struct BigNum(_);
Implementations
impl BigNum
impl BigNum
pub fn new(num: BigUint) -> Result<BigNum, ParseBigIntError>
pub fn div_floor(&self, other: &BigNum) -> BigNum
pub fn to_f64(&self) -> Option<f64>
pub fn to_u64(&self) -> Option<u64>
pub fn to_str_radix(&self, radix: u32) -> String
pub fn from_bytes_be(buf: &[u8]) -> BigNum
pub fn with_precision(whole_number: u64, with_precision: u8) -> BigNum
pub fn with_precision(whole_number: u64, with_precision: u8) -> BigNum
Trait Implementations
impl AddAssign<&BigNum> for BigNum
impl AddAssign<&BigNum> for BigNum
fn add_assign(&mut self, rhs: &BigNum)
fn add_assign(&mut self, rhs: &BigNum)
Performs the
+=
operation. Read moreimpl CheckedSub for BigNum
impl CheckedSub for BigNum
fn checked_sub(&self, v: &BigNum) -> Option<BigNum>
fn checked_sub(&self, v: &BigNum) -> Option<BigNum>
Subtracts two numbers, checking for underflow. If underflow happens,
None
is returned. Read moreimpl<'de> Deserialize<'de> for BigNum
impl<'de> Deserialize<'de> for BigNum
fn deserialize<__D>(
__deserializer: __D
) -> Result<BigNum, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<BigNum, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<'a> FromSql<'a> for BigNum
impl<'a> FromSql<'a> for BigNum
fn from_sql(
ty: &Type,
raw: &'a [u8]
) -> Result<BigNum, Box<dyn Error + Sync + Send + 'static, Global>>
fn from_sql(
ty: &Type,
raw: &'a [u8]
) -> Result<BigNum, Box<dyn Error + Sync + Send + 'static, Global>>
Creates a new value of this type from a buffer of data of the specified
Postgres
Type
in its binary format. Read morefn accepts(ty: &Type) -> bool
fn accepts(ty: &Type) -> bool
Determines if a value of this type can be created from the specified
Postgres
Type
. Read moreimpl Integer for BigNum
impl Integer for BigNum
fn is_multiple_of(&self, other: &BigNum) -> bool
fn is_multiple_of(&self, other: &BigNum) -> bool
fn div_rem(&self, other: &BigNum) -> (BigNum, BigNum)
fn div_rem(&self, other: &BigNum) -> (BigNum, BigNum)
Simultaneous truncated integer division and modulus.
Returns
(quotient, remainder)
. Read moresourcefn gcd_lcm(&self, other: &Self) -> (Self, Self)
fn gcd_lcm(&self, other: &Self) -> (Self, Self)
Greatest Common Divisor (GCD) and
Lowest Common Multiple (LCM) together. Read more
sourcefn extended_gcd(&self, other: &Self) -> ExtendedGcd<Self>where
Self: Clone,
fn extended_gcd(&self, other: &Self) -> ExtendedGcd<Self>where
Self: Clone,
Greatest common divisor and Bézout coefficients. Read more
sourcefn div_mod_floor(&self, other: &Self) -> (Self, Self)
fn div_mod_floor(&self, other: &Self) -> (Self, Self)
Simultaneous floored integer division and modulus.
Returns
(quotient, remainder)
. Read moresourcefn next_multiple_of(&self, other: &Self) -> Selfwhere
Self: Clone,
fn next_multiple_of(&self, other: &Self) -> Selfwhere
Self: Clone,
Rounds up to nearest multiple of argument. Read more
sourcefn prev_multiple_of(&self, other: &Self) -> Selfwhere
Self: Clone,
fn prev_multiple_of(&self, other: &Self) -> Selfwhere
Self: Clone,
Rounds down to nearest multiple of argument. Read more
impl Num for BigNum
impl Num for BigNum
type FromStrRadixErr = <BigUint as Num>::FromStrRadixErr
fn from_str_radix(
s: &str,
radix: u32
) -> Result<BigNum, <BigNum as Num>::FromStrRadixErr>
fn from_str_radix(
s: &str,
radix: u32
) -> Result<BigNum, <BigNum as Num>::FromStrRadixErr>
Convert from a string and radix (typically
2..=36
). Read moreimpl Ord for BigNum
impl Ord for BigNum
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
impl PartialOrd<BigNum> for BigNum
impl PartialOrd<BigNum> for BigNum
fn partial_cmp(&self, other: &BigNum) -> Option<Ordering>
fn partial_cmp(&self, other: &BigNum) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Serialize for BigNum
impl Serialize for BigNum
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl ToSql for BigNum
impl ToSql for BigNum
fn to_sql(
&self,
ty: &Type,
w: &mut BytesMut
) -> Result<IsNull, Box<dyn Error + Sync + Send + 'static, Global>>
fn to_sql(
&self,
ty: &Type,
w: &mut BytesMut
) -> Result<IsNull, Box<dyn Error + Sync + Send + 'static, Global>>
Converts the value of
self
into the binary format of the specified
Postgres Type
, appending it to out
. Read morefn accepts(ty: &Type) -> bool
fn accepts(ty: &Type) -> bool
Determines if a value of this type can be converted to the specified
Postgres
Type
. Read morefn to_sql_checked(
&self,
ty: &Type,
out: &mut BytesMut
) -> Result<IsNull, Box<dyn Error + Sync + Send + 'static, Global>>
fn to_sql_checked(
&self,
ty: &Type,
out: &mut BytesMut
) -> Result<IsNull, Box<dyn Error + Sync + Send + 'static, Global>>
An adaptor method used internally by Rust-Postgres. Read more
sourcefn encode_format(&self, _ty: &Type) -> Format
fn encode_format(&self, _ty: &Type) -> Format
Specify the encode format
impl Eq for BigNum
impl StructuralEq for BigNum
impl StructuralPartialEq for BigNum
Auto Trait Implementations
impl RefUnwindSafe for BigNum
impl Send for BigNum
impl Sync for BigNum
impl Unpin for BigNum
impl UnwindSafe for BigNum
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> BorrowToSql for Twhere
T: ToSql,
impl<T> BorrowToSql for Twhere
T: ToSql,
sourcefn borrow_to_sql(&self) -> &dyn ToSql
fn borrow_to_sql(&self) -> &dyn ToSql
Returns a reference to
self
as a ToSql
trait object.sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.