pub struct NumericTypmod { /* private fields */ }Expand description
The modifier of a numeric(p, s) type, the precision and scale it rounds to.
Implementations§
Source§impl NumericTypmod
impl NumericTypmod
Sourcepub fn new(precision: u16, scale: i16) -> Option<Self>
pub fn new(precision: u16, scale: i16) -> Option<Self>
numerictypmodin, or None for a precision outside 1..=1000 or a scale outside
-1000..=1000. numeric(p) is a scale of 0.
use sql_values::postgres::NumericTypmod;
assert!(NumericTypmod::new(4, 1).is_some());
assert!(NumericTypmod::new(2, -3).is_some());
assert!(NumericTypmod::new(0, 0).is_none());
assert!(NumericTypmod::new(1001, 0).is_none());Trait Implementations§
Source§impl Clone for NumericTypmod
impl Clone for NumericTypmod
impl Copy for NumericTypmod
Source§impl Debug for NumericTypmod
impl Debug for NumericTypmod
impl Eq for NumericTypmod
Source§impl Hash for NumericTypmod
impl Hash for NumericTypmod
Source§impl PartialEq for NumericTypmod
impl PartialEq for NumericTypmod
impl StructuralPartialEq for NumericTypmod
Auto Trait Implementations§
impl Forget for NumericTypmod
impl Freeze for NumericTypmod
impl Move for NumericTypmod
impl RefUnwindSafe for NumericTypmod
impl Send for NumericTypmod
impl Sync for NumericTypmod
impl Unpin for NumericTypmod
impl UnsafeUnpin for NumericTypmod
impl UnwindSafe for NumericTypmod
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more