[−][src]Struct pgnumeric::Typmod
Type modifier.
For numeric, Typmod
is composed by precision
and scale
.
They are converted into a internal integer value.
Implementations
impl Typmod
[src]
pub unsafe fn new_unchecked(precision: i32, scale: i32) -> Self
[src]
Creates a Typmod
.
Safety
Callers have to guarantee that:
1 <= precision <= NUMERIC_MAX_PRECISION
0 <= scale <= precision
pub unsafe fn with_precision_unchecked(precision: i32) -> Self
[src]
Creates a Typmod
.
scale
defaults to zero.
Safety
Callers have to guarantee that:
1 <= precision <= NUMERIC_MAX_PRECISION
pub fn new(precision: i32, scale: i32) -> Option<Self>
[src]
Creates a Typmod
.
Returns None
:
- if
1 <= precision <= NUMERIC_MAX_PRECISION
- if
0 <= scale <= precision
pub fn with_precision(precision: i32) -> Option<Self>
[src]
Creates a Typmod
.
scale
defaults to zero.
Returns None
:
- if
1 <= precision <= NUMERIC_MAX_PRECISION
pub unsafe fn from_value_unchecked(value: i32) -> Self
[src]
pub const fn value(self) -> i32
[src]
Returns Typmod
's value in i32
.
pub const fn extract(self) -> (i32, i32)
[src]
Extracts (precision, scale)
from Typmod
.
Trait Implementations
impl Clone for Typmod
[src]
impl Copy for Typmod
[src]
impl Debug for Typmod
[src]
impl Default for Typmod
[src]
impl Display for Typmod
[src]
impl Eq for Typmod
[src]
impl PartialEq<Typmod> for Typmod
[src]
impl StructuralEq for Typmod
[src]
impl StructuralPartialEq for Typmod
[src]
Auto Trait Implementations
impl RefUnwindSafe for Typmod
impl Send for Typmod
impl Sync for Typmod
impl Unpin for Typmod
impl UnwindSafe for Typmod
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,