File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,6 +43,9 @@ mod u32;
4343mod u64;
4444mod u8;
4545
46+ use std:: fmt:: Display ;
47+ use std:: str:: FromStr ;
48+
4649pub ( crate ) use bigdecimal:: BigDecimal ;
4750use thiserror:: Error ;
4851pub use u128:: * ;
@@ -73,11 +76,17 @@ mod private {
7376 pub trait Sealed { }
7477}
7578
79+ impl private:: Sealed for u8 { }
80+ impl private:: Sealed for u16 { }
81+ impl private:: Sealed for u32 { }
82+ impl private:: Sealed for u64 { }
83+ impl private:: Sealed for u128 { }
84+
7685/// Helper trait to define the underlying integer type for a given `PgUint` type. Used in the
7786/// `sqlx-pg-uint-macros` crate to generate the necessary code for the `UIntWrapper` derive.
7887///
7988/// Not intended to be implemented by users, nor is it required to be used directly.
80- pub trait UIntType : private:: Sealed {
89+ pub trait UIntType : private:: Sealed + Display {
8190 /// The underlying integer type for the `PgUint` type.
82- type Uint ;
91+ type Uint : private :: Sealed + FromStr ;
8392}
You can’t perform that action at this time.
0 commit comments