| 1 | use sqlx_corerust-analyzer cargo sqlx-core 0.8.3 crate/::bytesrust-analyzer cargo bytes 1.12.1 crate/::Bufrust-analyzer cargo bytes 1.12.1 buf/buf_impl/Buf#; |
| 2 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::numrust-analyzer cargo std https://github.com/rust-lang/rust/library/std num/::Saturatingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/saturating/Saturating#; |
| 3 | |
| 4 | use craterust-analyzer cargo sqlx-postgres 0.8.3 crate/::errorrust-analyzer cargo sqlx-postgres 0.8.3 error/::BoxDynErrorrust-analyzer cargo sqlx-core 0.8.3 error/BoxDynError#; |
| 5 | use craterust-analyzer cargo sqlx-postgres 0.8.3 crate/::PgArgumentBufferrust-analyzer cargo sqlx-postgres 0.8.3 arguments/PgArgumentBuffer#; |
| 6 | |
| 7 | /// Represents a `NUMERIC` value in the **Postgres** wire protocol. |
| 8 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:)] |
| 9 | pub(craterust-analyzer cargo sqlx-postgres 0.8.3 crate/) enum PgNumericrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric# { |
| 10 | /// Equivalent to the `'NaN'` value in Postgres. The result of, e.g. `1 / 0`. |
| 11 | NotANumberrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#NotANumber#, |
| 12 | |
| 13 | /// A populated `NUMERIC` value. |
| 14 | /// |
| 15 | /// A description of these fields can be found here (although the type being described is the |
| 16 | /// version for in-memory calculations, the field names are the same): |
| 17 | /// https://github.com/postgres/postgres/blob/bcd1c3630095e48bc3b1eb0fc8e8c8a7c851eba1/src/backend/utils/adt/numeric.c#L224-L269 |
| 18 | Numberrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#Number# { |
| 19 | /// The sign of the value: positive (also set for 0 and -0), or negative. |
| 20 | signrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#Number#sign.: PgNumericSignrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumericSign#, |
| 21 | |
| 22 | /// The digits of the number in base-10000 with the most significant digit first |
| 23 | /// (big-endian). |
| 24 | /// |
| 25 | /// The length of this vector must not overflow `i16` for the binary protocol. |
| 26 | /// |
| 27 | /// *Note*: the `Encode` implementation will panic if any digit is `>= 10000`. |
| 28 | digitsrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#Number#digits.: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<i16>, |
| 29 | |
| 30 | /// The scaling factor of the number, such that the value will be interpreted as |
| 31 | /// |
| 32 | /// ```text |
| 33 | /// digits[0] * 10,000 ^ weight |
| 34 | /// + digits[1] * 10,000 ^ (weight - 1) |
| 35 | /// ... |
| 36 | /// + digits[N] * 10,000 ^ (weight - N) where N = digits.len() - 1 |
| 37 | /// ``` |
| 38 | /// May be negative. |
| 39 | weightrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#Number#weight.: i16, |
| 40 | |
| 41 | /// How many _decimal_ (base-10) digits following the decimal point to consider in |
| 42 | /// arithmetic regardless of how many actually follow the decimal point as determined by |
| 43 | /// `weight`--the comment in the Postgres code linked above recommends using this only for |
| 44 | /// ignoring unnecessary trailing zeroes (as trimming nonzero digits means reducing the |
| 45 | /// precision of the value). |
| 46 | /// |
| 47 | /// Must be `>= 0`. |
| 48 | scalerust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#Number#scale.: i16, |
| 49 | }, |
| 50 | } |
| 51 | |
| 52 | // https://github.com/postgres/postgres/blob/bcd1c3630095e48bc3b1eb0fc8e8c8a7c851eba1/src/backend/utils/adt/numeric.c#L167-L170 |
| 53 | const SIGN_POSrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/SIGN_POS.: u16 = 0x0000; |
| 54 | const SIGN_NEGrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/SIGN_NEG.: u16 = 0x4000; |
| 55 | const SIGN_NANrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/SIGN_NAN.: u16 = 0xC000; // overflows i16 (C equivalent truncates from integer literal) |
| 56 | |
| 57 | /// Possible sign values for [PgNumeric]. |
| 58 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:)] |
| 59 | #[repr(u16)] |
| 60 | pub(craterust-analyzer cargo sqlx-postgres 0.8.3 crate/) enum PgNumericSignrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumericSign# { |
| 61 | Positiverust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumericSign#Positive# = SIGN_POSrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/SIGN_POS., |
| 62 | Negativerust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumericSign#Negative# = SIGN_NEGrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/SIGN_NEG., |
| 63 | } |
| 64 | |
| 65 | impl PgNumericSignrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumericSign# { |
| 66 | fn try_from_u16rust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/impl#[PgNumericSign]try_from_u16().(val: u16) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/impl#[PgNumericSign], BoxDynErrorrust-analyzer cargo sqlx-core 0.8.3 error/BoxDynError#> { |
| 67 | match val { |
| 68 | SIGN_POSrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/SIGN_POS. => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(PgNumericSignrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumericSign#::Positiverust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumericSign#Positive#), |
| 69 | SIGN_NEGrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/SIGN_NEG. => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(PgNumericSignrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumericSign#::Negativerust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumericSign#Negative#), |
| 70 | |
| 71 | SIGN_NANrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/SIGN_NAN. => unreachablerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/unreachable!!("sign value for NaN passed to PgNumericSign"), |
| 72 | |
| 73 | _ => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("invalid value for PgNumericSign: {val:#04X}").intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()), |
| 74 | } |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | impl PgNumericrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric# { |
| 79 | /// Equivalent value of `0::numeric`. |
| 80 | pub const ZEROrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/impl#[PgNumeric]ZERO.: Selfrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/impl#[PgNumeric] = PgNumericrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#::Numberrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#Number# { |
| 81 | signrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#Number#sign.: PgNumericSignrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumericSign#::Positiverust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumericSign#Positive#, |
| 82 | digitsrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#Number#digits.: vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![], |
| 83 | weightrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#Number#weight.: 0, |
| 84 | scalerust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#Number#scale.: 0, |
| 85 | }; |
| 86 | |
| 87 | pub(craterust-analyzer cargo sqlx-postgres 0.8.3 crate/) fn is_valid_digitrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/impl#[PgNumeric]is_valid_digit().(digit: i16) -> bool { |
| 88 | (0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#10_000).containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/impl#[`Range<Idx>`]contains().(&digit) |
| 89 | } |
| 90 | |
| 91 | pub(craterust-analyzer cargo sqlx-postgres 0.8.3 crate/) fn size_hintrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/impl#[PgNumeric]size_hint().(decimal_digits: u64) -> usize { |
| 92 | let mut size_hint = Saturatingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/saturating/Saturating#(decimal_digits); |
| 93 | |
| 94 | // BigDecimal::digits() gives us base-10 digits, so we divide by 4 to get base-10000 digits |
| 95 | // and since this is just a hint we just always round up |
| 96 | size_hint rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/saturating/impl#[`Saturating<u64>`][`DivAssign<u64>`]div_assign()./=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/saturating/impl#[`Saturating<u64>`][`DivAssign<u64>`]div_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/saturating/impl#[`Saturating<u64>`][`DivAssign<u64>`]div_assign().4; |
| 97 | size_hint rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/saturating/impl#[`Saturating<u64>`][`AddAssign<u64>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/saturating/impl#[`Saturating<u64>`][`AddAssign<u64>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/saturating/impl#[`Saturating<u64>`][`AddAssign<u64>`]add_assign().1; |
| 98 | |
| 99 | // Times two bytes for each base-10000 digit |
| 100 | size_hint rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/saturating/impl#[`Saturating<u64>`][`MulAssign<u64>`]mul_assign().*=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/saturating/impl#[`Saturating<u64>`][`MulAssign<u64>`]mul_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/saturating/impl#[`Saturating<u64>`][`MulAssign<u64>`]mul_assign().2; |
| 101 | |
| 102 | // Plus `weight` and `scale` |
| 103 | size_hint rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/saturating/impl#[`Saturating<u64>`][`AddAssign<u64>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/saturating/impl#[`Saturating<u64>`][`AddAssign<u64>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/saturating/impl#[`Saturating<u64>`][`AddAssign<u64>`]add_assign().8; |
| 104 | |
| 105 | usize::try_fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/ptr_try_from_impls/impl#[usize][`TryFrom<u64>`]try_from().(size_hint.0rust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/saturating/Saturating#0.).unwrap_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_or().(usize::MAXrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[usize]MAX.) |
| 106 | } |
| 107 | |
| 108 | pub(craterust-analyzer cargo sqlx-postgres 0.8.3 crate/) fn decoderust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/impl#[PgNumeric]decode().(mut buf: &[u8]) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/impl#[PgNumeric], BoxDynErrorrust-analyzer cargo sqlx-core 0.8.3 error/BoxDynError#> { |
| 109 | // https://github.com/postgres/postgres/blob/bcd1c3630095e48bc3b1eb0fc8e8c8a7c851eba1/src/backend/utils/adt/numeric.c#L874 |
| 110 | let num_digits = buf.get_u16rust-analyzer cargo bytes 1.12.1 buf/buf_impl/Buf#get_u16().(); |
| 111 | let weight = buf.get_i16rust-analyzer cargo bytes 1.12.1 buf/buf_impl/Buf#get_i16().(); |
| 112 | let sign = buf.get_u16rust-analyzer cargo bytes 1.12.1 buf/buf_impl/Buf#get_u16().(); |
| 113 | let scale = buf.get_i16rust-analyzer cargo bytes 1.12.1 buf/buf_impl/Buf#get_i16().(); |
| 114 | |
| 115 | if sign rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]eq().SIGN_NANrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/SIGN_NAN. { |
| 116 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(PgNumericrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#::NotANumberrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#NotANumber#) |
| 117 | } else { |
| 118 | let digits: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_> = (0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#num_digits).maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|_| buf.get_i16rust-analyzer cargo bytes 1.12.1 buf/buf_impl/Buf#get_i16().()).collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<_>(); |
| 119 | |
| 120 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(PgNumericrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#::Numberrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#Number# { |
| 121 | signrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#Number#sign.: PgNumericSignrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumericSign#::try_from_u16rust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/impl#[PgNumericSign]try_from_u16().(sign)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 122 | scalerust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#Number#scale., |
| 123 | weightrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#Number#weight., |
| 124 | digitsrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#Number#digits., |
| 125 | }) |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | /// ### Errors |
| 130 | /// |
| 131 | /// * If `digits.len()` overflows `i16` |
| 132 | /// * If any element in `digits` is greater than or equal to 10000 |
| 133 | pub(craterust-analyzer cargo sqlx-postgres 0.8.3 crate/) fn encoderust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/impl#[PgNumeric]encode().(&self, buf: &mut PgArgumentBufferrust-analyzer cargo sqlx-postgres 0.8.3 arguments/PgArgumentBuffer#) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#> { |
| 134 | match *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self { |
| 135 | PgNumericrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#::Numberrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#Number# { |
| 136 | ref digitsrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#Number#digits., |
| 137 | signrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#Number#sign., |
| 138 | scalerust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#Number#scale., |
| 139 | weightrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#Number#weight., |
| 140 | } => { |
| 141 | let digits_len = i16::try_fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/ptr_try_from_impls/impl#[i16][`TryFrom<usize>`]try_from().(digits.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().()).map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|_| { |
| 142 | formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!( |
| 143 | "PgNumeric digits.len() ({}) should not overflow i16", |
| 144 | digits.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().() |
| 145 | ) |
| 146 | })?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 147 | |
| 148 | buf.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<&'a T>`]extend().(&digits_len.to_be_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i16]to_be_bytes().()); |
| 149 | buf.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<&'a T>`]extend().(&weight.to_be_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i16]to_be_bytes().()); |
| 150 | buf.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<&'a T>`]extend().(&(sign as i16).to_be_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i16]to_be_bytes().()); |
| 151 | buf.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<&'a T>`]extend().(&scale.to_be_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i16]to_be_bytes().()); |
| 152 | |
| 153 | for (i, &digit) in digits.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().enumeraterust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#enumerate().() { |
| 154 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().Selfrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/impl#[PgNumeric]::is_valid_digitrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/impl#[PgNumeric]is_valid_digit().(digit) { |
| 155 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{i}th PgNumeric digit out of range: {digit}")); |
| 156 | } |
| 157 | |
| 158 | buf.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<&'a T>`]extend().(&digit.to_be_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i16]to_be_bytes().()); |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | PgNumericrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#::NotANumberrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/PgNumeric#NotANumber# => { |
| 163 | buf.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<&'a T>`]extend().(&0_i16.to_be_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i16]to_be_bytes().()); |
| 164 | buf.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<&'a T>`]extend().(&0_i16.to_be_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i16]to_be_bytes().()); |
| 165 | buf.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<&'a T>`]extend().(&SIGN_NANrust-analyzer cargo sqlx-postgres 0.8.3 types/numeric/SIGN_NAN..to_be_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]to_be_bytes().()); |
| 166 | buf.extendrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Extend<&'a T>`]extend().(&0_i16.to_be_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[i16]to_be_bytes().()); |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 171 | } |
| 172 | } |