Struct pg_bigdecimal::PgNumeric
source · [−]pub struct PgNumeric {
pub n: Option<BigDecimal>,
}
Expand description
A rust variant of the Postgres Numeric type. The full spectrum of Postgres’ Numeric value range is supported.
Represented as an Optional BigDecimal. None for ‘NaN’, Some(bigdecimal) for all other values.
Fields
n: Option<BigDecimal>
Implementations
Trait Implementations
sourceimpl<'a> FromSql<'a> for PgNumeric
impl<'a> FromSql<'a> for PgNumeric
sourcefn from_sql(
_: &Type,
raw: &'a [u8]
) -> Result<Self, Box<dyn Error + Sync + Send + 'static>>
fn from_sql(
_: &Type,
raw: &'a [u8]
) -> Result<Self, Box<dyn Error + Sync + Send + 'static>>
Creates a new value of this type from a buffer of data of the specified
Postgres Type
in its binary format. Read more
sourcefn accepts(ty: &Type) -> bool
fn accepts(ty: &Type) -> bool
Determines if a value of this type can be created from the specified
Postgres Type
. Read more
sourceimpl Ord for PgNumeric
impl Ord for PgNumeric
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<PgNumeric> for PgNumeric
impl PartialEq<PgNumeric> for PgNumeric
sourceimpl PartialOrd<PgNumeric> for PgNumeric
impl PartialOrd<PgNumeric> for PgNumeric
sourcefn partial_cmp(&self, other: &PgNumeric) -> Option<Ordering>
fn partial_cmp(&self, other: &PgNumeric) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl ToSql for PgNumeric
impl ToSql for PgNumeric
sourcefn to_sql(
&self,
_: &Type,
out: &mut BytesMut
) -> Result<IsNull, Box<dyn Error + Sync + Send + 'static>>
fn to_sql(
&self,
_: &Type,
out: &mut BytesMut
) -> Result<IsNull, Box<dyn Error + Sync + Send + 'static>>
Converts the value of self
into the binary format of the specified
Postgres Type
, appending it to out
. Read more
sourcefn accepts(ty: &Type) -> bool
fn accepts(ty: &Type) -> bool
Determines if a value of this type can be converted to the specified
Postgres Type
. Read more
sourcefn to_sql_checked(
&self,
ty: &Type,
out: &mut BytesMut
) -> Result<IsNull, Box<dyn Error + Sync + Send>>
fn to_sql_checked(
&self,
ty: &Type,
out: &mut BytesMut
) -> Result<IsNull, Box<dyn Error + Sync + Send>>
An adaptor method used internally by Rust-Postgres. Read more
sourcefn encode_format(&self, _ty: &Type) -> Format
fn encode_format(&self, _ty: &Type) -> Format
Specify the encode format
impl Eq for PgNumeric
impl StructuralEq for PgNumeric
impl StructuralPartialEq for PgNumeric
Auto Trait Implementations
impl RefUnwindSafe for PgNumeric
impl Send for PgNumeric
impl Sync for PgNumeric
impl Unpin for PgNumeric
impl UnwindSafe for PgNumeric
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> BorrowToSql for Twhere
T: ToSql,
impl<T> BorrowToSql for Twhere
T: ToSql,
sourcefn borrow_to_sql(&self) -> &dyn ToSql
fn borrow_to_sql(&self) -> &dyn ToSql
Returns a reference to self
as a ToSql
trait object.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,
impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more