Struct BigInt

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

BigInt wrapper

This type may not be necessary, but it is used to get around the orphan rule for implementing async-graphql and sqlx traits.

Implementations§

Source§

impl BigInt

Source

pub fn new(inner: BIO) -> Self

Source

pub fn into_inner(self) -> BIO

Source

pub fn as_inner(&self) -> &BIO

Source§

impl BigInt

Source

pub fn abs(&self) -> Self

Source

pub fn sign(&self) -> Sign

Source

pub fn to_bytes_le(&self) -> (Sign, Vec<u8>)

Source

pub fn to_bytes_be(&self) -> (Sign, Vec<u8>)

Source

pub fn checked_add(&self, v: &Self) -> Option<Self>

Source

pub fn checked_sub(&self, v: &Self) -> Option<Self>

Source

pub fn checked_mul(&self, v: &Self) -> Option<Self>

Source

pub fn checked_div(&self, v: &Self) -> Option<Self>

Source

pub fn from_bytes_be(sign: impl Into<Sign>, bytes: &[u8]) -> Self

Source

pub fn from_bytes_le(sign: impl Into<Sign>, bytes: &[u8]) -> Self

Source

pub fn from_signed_bytes_be(bytes: &[u8]) -> Self

Source

pub fn from_signed_bytes_le(bytes: &[u8]) -> Self

Source

pub fn from_radix_be( sign: impl Into<Sign>, buf: &[u8], radix: u32, ) -> Option<Self>

Source

pub fn from_radix_le( sign: impl Into<Sign>, buf: &[u8], radix: u32, ) -> Option<Self>

Source

pub fn from_slice(sign: impl Into<Sign>, slice: &[u32]) -> Self

Trait Implementations§

Source§

impl<'x> Add<BigInt> for &'x BigInt

Source§

type Output = BigInt

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl<T: Into<BigInt>> Add<T> for BigInt

Source§

type Output = BigInt

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl<'x> Add for &'x BigInt

Source§

type Output = BigInt

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &'x BigInt) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: Into<BigInt>> AddAssign<T> for BigInt

Source§

fn add_assign(&mut self, rhs: T)

Performs the += operation. Read more
Source§

impl Clone for BigInt

Source§

fn clone(&self) -> BigInt

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 BigInt

Source§

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

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

impl<'r> Decode<'r, Postgres> for BigInt

Source§

fn decode( value: <Postgres as Database>::ValueRef<'r>, ) -> Result<Self, BoxDynError>

Decode a new value of this type using a raw value from the database.
Source§

impl Default for BigInt

Source§

fn default() -> BigInt

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

impl<'de> Deserialize<'de> for BigInt

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for BigInt

Source§

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

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

impl<'x> Div<BigInt> for &'x BigInt

Source§

type Output = BigInt

The resulting type after applying the / operator.
Source§

fn div(self, rhs: BigInt) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: Into<BigInt>> Div<T> for BigInt

Source§

type Output = BigInt

The resulting type after applying the / operator.
Source§

fn div(self, rhs: T) -> Self::Output

Performs the / operation. Read more
Source§

impl<'x> Div for &'x BigInt

Source§

type Output = BigInt

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &'x BigInt) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: Into<BigInt>> DivAssign<T> for BigInt

Source§

fn div_assign(&mut self, rhs: T)

Performs the /= operation. Read more
Source§

impl<'q> Encode<'q, Postgres> for BigInt

Source§

fn encode_by_ref( &self, buf: &mut <Postgres as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync + 'static>>

Writes the value of self into buf without moving self. Read more
Source§

fn encode( self, buf: &mut <Postgres as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync + 'static>>
where Self: Sized,

Writes the value of self into buf in the expected format for the database.
Source§

fn produces(&self) -> Option<<DB as Database>::TypeInfo>

Source§

fn size_hint(&self) -> usize

Source§

impl From<&BigInt> for BigDecimal

Source§

fn from(value: &BigInt) -> Self

Converts to this type from the input type.
Source§

impl From<&BigInt> for BigDecimal

Source§

fn from(bi: &BigInt) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<&U<N>> for BigInt

Source§

fn from(u: &U<N>) -> Self

Converts to this type from the input type.
Source§

impl From<BigInt> for BigDecimal

Source§

fn from(value: BigInt) -> Self

Converts to this type from the input type.
Source§

impl From<BigInt> for BigDecimal

Source§

fn from(bi: BigInt) -> Self

Converts to this type from the input type.
Source§

impl From<BigInt> for BigInt

Source§

fn from(value: BI) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<U<N>> for BigInt

Source§

fn from(u: U<N>) -> Self

Converts to this type from the input type.
Source§

impl From<i128> for BigInt

Source§

fn from(v: i128) -> Self

Converts to this type from the input type.
Source§

impl From<i16> for BigInt

Source§

fn from(v: i16) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for BigInt

Source§

fn from(v: i32) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for BigInt

Source§

fn from(v: i64) -> Self

Converts to this type from the input type.
Source§

impl From<i8> for BigInt

Source§

fn from(v: i8) -> Self

Converts to this type from the input type.
Source§

impl From<isize> for BigInt

Source§

fn from(v: isize) -> Self

Converts to this type from the input type.
Source§

impl From<u128> for BigInt

Source§

fn from(v: u128) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for BigInt

Source§

fn from(v: u16) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for BigInt

Source§

fn from(v: u32) -> Self

Converts to this type from the input type.
Source§

impl From<u64> for BigInt

Source§

fn from(v: u64) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for BigInt

Source§

fn from(v: u8) -> Self

Converts to this type from the input type.
Source§

impl From<usize> for BigInt

Source§

fn from(v: usize) -> Self

Converts to this type from the input type.
Source§

impl FromPrimitive for BigInt

Source§

fn from_i64(n: i64) -> Option<Self>

Converts an i64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u64(n: u64) -> Option<Self>

Converts an u64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_isize(n: isize) -> Option<Self>

Converts an isize to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i8(n: i8) -> Option<Self>

Converts an i8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i16(n: i16) -> Option<Self>

Converts an i16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i32(n: i32) -> Option<Self>

Converts an i32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i128(n: i128) -> Option<Self>

Converts an i128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Source§

fn from_usize(n: usize) -> Option<Self>

Converts a usize to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u8(n: u8) -> Option<Self>

Converts an u8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u16(n: u16) -> Option<Self>

Converts an u16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u32(n: u32) -> Option<Self>

Converts an u32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u128(n: u128) -> Option<Self>

Converts an u128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Source§

fn from_f32(n: f32) -> Option<Self>

Converts a f32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_f64(n: f64) -> Option<Self>

Converts a f64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Source§

impl FromStr for BigInt

Source§

type Err = <BigInt as FromStr>::Err

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for BigInt

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 Hashable for BigInt

Source§

fn variant() -> ValueVariant

Source§

fn with_new<H: StableHasher>(&self, field_address: H::Addr, state: &mut H)

Source§

fn variant_numeric() -> u8

Source§

impl InputType for BigInt

Source§

type RawValueType = BigInt

The raw type used for validator. Read more
Source§

fn type_name() -> Cow<'static, str>

Type the name.
Source§

fn create_type_info(registry: &mut Registry) -> String

Create type information in the registry and return qualified typename.
Source§

fn parse(value: Option<Value>) -> InputValueResult<Self>

Parse from Value. None represents undefined.
Source§

fn to_value(&self) -> Value

Convert to a Value for introspection.
Source§

fn as_raw_value(&self) -> Option<&Self::RawValueType>

Returns a reference to the raw value.
Source§

fn qualified_type_name() -> String

Qualified typename.
Source§

impl<'x> Mul<BigInt> for &'x BigInt

Source§

type Output = BigInt

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl<T: Into<BigInt>> Mul<T> for BigInt

Source§

type Output = BigInt

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl<'x> Mul for &'x BigInt

Source§

type Output = BigInt

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &'x BigInt) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: Into<BigInt>> MulAssign<T> for BigInt

Source§

fn mul_assign(&mut self, rhs: T)

Performs the *= operation. Read more
Source§

impl Neg for BigInt

Source§

type Output = BigInt

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl One for BigInt

Source§

fn one() -> Self

Returns the multiplicative identity element of Self, 1. Read more
Source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
Source§

fn is_one(&self) -> bool
where Self: PartialEq,

Returns true if self is equal to the multiplicative identity. Read more
Source§

impl Ord for BigInt

Source§

fn cmp(&self, other: &BigInt) -> 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 OutputType for BigInt

Source§

fn type_name() -> Cow<'static, str>

Type the name.
Source§

fn create_type_info(registry: &mut Registry) -> String

Create type information in the registry and return qualified typename.
Source§

async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>

Resolve an output value to async_graphql::Value.
Source§

fn qualified_type_name() -> String

Qualified typename.
Source§

fn introspection_type_name(&self) -> Cow<'static, str>

Introspection type name Read more
Source§

impl PartialEq for BigInt

Source§

fn eq(&self, other: &BigInt) -> 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 BigInt

Source§

fn partial_cmp(&self, other: &BigInt) -> 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 PgHasArrayType for BigInt

Source§

impl ScalarType for BigInt

Source§

fn parse(value: Value) -> InputValueResult<Self>

Parse a scalar value.
Source§

fn to_value(&self) -> Value

Convert the scalar to Value.
Source§

fn is_valid(_value: &ConstValue) -> bool

Checks for a valid scalar value. Read more
Source§

impl Serialize for BigInt

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'x> Sub<BigInt> for &'x BigInt

Source§

type Output = BigInt

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<T: Into<BigInt>> Sub<T> for BigInt

Source§

type Output = BigInt

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<'x> Sub for &'x BigInt

Source§

type Output = BigInt

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &'x BigInt) -> Self::Output

Performs the - operation. Read more
Source§

impl<T: Into<BigInt>> SubAssign<T> for BigInt

Source§

fn sub_assign(&mut self, rhs: T)

Performs the -= operation. Read more
Source§

impl ToPrimitive for BigInt

Source§

fn to_i64(&self) -> Option<i64>

Converts the value of self to an i64. If the value cannot be represented by an i64, then None is returned.
Source§

fn to_u64(&self) -> Option<u64>

Converts the value of self to a u64. If the value cannot be represented by a u64, then None is returned.
Source§

fn to_isize(&self) -> Option<isize>

Converts the value of self to an isize. If the value cannot be represented by an isize, then None is returned.
Source§

fn to_i8(&self) -> Option<i8>

Converts the value of self to an i8. If the value cannot be represented by an i8, then None is returned.
Source§

fn to_i16(&self) -> Option<i16>

Converts the value of self to an i16. If the value cannot be represented by an i16, then None is returned.
Source§

fn to_i32(&self) -> Option<i32>

Converts the value of self to an i32. If the value cannot be represented by an i32, then None is returned.
Source§

fn to_i128(&self) -> Option<i128>

Converts the value of self to an i128. If the value cannot be represented by an i128 (i64 under the default implementation), then None is returned. Read more
Source§

fn to_usize(&self) -> Option<usize>

Converts the value of self to a usize. If the value cannot be represented by a usize, then None is returned.
Source§

fn to_u8(&self) -> Option<u8>

Converts the value of self to a u8. If the value cannot be represented by a u8, then None is returned.
Source§

fn to_u16(&self) -> Option<u16>

Converts the value of self to a u16. If the value cannot be represented by a u16, then None is returned.
Source§

fn to_u32(&self) -> Option<u32>

Converts the value of self to a u32. If the value cannot be represented by a u32, then None is returned.
Source§

fn to_u128(&self) -> Option<u128>

Converts the value of self to a u128. If the value cannot be represented by a u128 (u64 under the default implementation), then None is returned. Read more
Source§

fn to_f32(&self) -> Option<f32>

Converts the value of self to an f32. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f32.
Source§

fn to_f64(&self) -> Option<f64>

Converts the value of self to an f64. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f64. Read more
Source§

impl Type<Postgres> for BigInt

Source§

fn type_info() -> <Postgres as Database>::TypeInfo

Returns the canonical SQL type for this Rust type. Read more
Source§

fn compatible(ty: &<DB as Database>::TypeInfo) -> bool

Determines if this Rust type is compatible with the given SQL type. Read more
Source§

impl Zero for BigInt

Source§

fn zero() -> Self

Returns the additive identity element of Self, 0. Read more
Source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
Source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
Source§

impl Eq for BigInt

Source§

impl StructuralPartialEq for BigInt

Auto Trait Implementations§

§

impl Freeze for BigInt

§

impl RefUnwindSafe for BigInt

§

impl Send for BigInt

§

impl Sync for BigInt

§

impl Unpin for BigInt

§

impl UnwindSafe for BigInt

Blanket Implementations§

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> 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<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<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<I> FromRadix10 for I
where I: Zero + One + AddAssign + MulAssign,

Source§

fn from_radix_10(text: &[u8]) -> (I, usize)

Parses an integer from a slice. Read more
Source§

impl<I> FromRadix10Signed for I

Source§

fn from_radix_10_signed(text: &[u8]) -> (I, usize)

Parses an integer from a slice. Read more
Source§

impl<I> FromRadix16 for I
where I: Zero + One + AddAssign + MulAssign,

Source§

fn from_radix_16(text: &[u8]) -> (I, usize)

Parses an integer from a slice. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> Erased for T

Source§

impl<T> ErasedDestructor for T
where T: 'static,