mssql_value_serializer/literals/
num_bigint.rs

1use std::fmt::{Formatter, Write};
2
3use num_bigint::{BigInt, BigUint};
4
5use super::{SqlLiteralError, SqlServerLiteral};
6use crate::impl_dyn_wrapper;
7
8impl SqlServerLiteral for BigInt {
9    #[inline]
10    fn append_sql_literal(&self, out: &mut String) -> Result<(), SqlLiteralError> {
11        write!(out, "{}", self).unwrap();
12
13        Ok(())
14    }
15
16    #[inline]
17    fn append_sql_literal_fmt(&self, out: &mut Formatter<'_>) -> Result<(), SqlLiteralError> {
18        write!(out, "{}", self).unwrap();
19
20        Ok(())
21    }
22}
23
24impl_dyn_wrapper!(BigInt);
25
26impl SqlServerLiteral for BigUint {
27    #[inline]
28    fn append_sql_literal(&self, out: &mut String) -> Result<(), SqlLiteralError> {
29        write!(out, "{}", self).unwrap();
30
31        Ok(())
32    }
33
34    #[inline]
35    fn append_sql_literal_fmt(&self, out: &mut Formatter<'_>) -> Result<(), SqlLiteralError> {
36        write!(out, "{}", self).unwrap();
37
38        Ok(())
39    }
40}
41
42impl_dyn_wrapper!(BigUint);