pub struct FixedPoint256<const SCALE: u64>(pub i256);Expand description
Wrapper type for ClickHouse FixedPoint256 type.
Tuple Fields§
§0: i256Implementations§
Source§impl<const SCALE: u64> FixedPoint256<SCALE>
impl<const SCALE: u64> FixedPoint256<SCALE>
Sourcepub const MAX: Self
pub const MAX: Self
The maximum value for FixedPoint256
Sourcepub const MIN: Self
pub const MIN: Self
The minimum value for FixedPoint256
Sourcepub fn from_raw(value: i128) -> Self
pub fn from_raw(value: i128) -> Self
Create a fixed-point number from a raw scaled integer value The value is assumed to already have the correct scaling applied
Sourcepub fn from_parts(value: i128, exponent: i32) -> Self
pub fn from_parts(value: i128, exponent: i32) -> Self
Create a fixed-point number from a value and decimal exponent e.g., (123, -2) represents 123 × 10^-2 = 1.23
Sourcepub fn is_negative(&self) -> bool
pub fn is_negative(&self) -> bool
Check if the value is negative
Trait Implementations§
Source§impl<const SCALE: u64> Clone for FixedPoint256<SCALE>
impl<const SCALE: u64> Clone for FixedPoint256<SCALE>
Source§fn clone(&self) -> FixedPoint256<SCALE>
fn clone(&self) -> FixedPoint256<SCALE>
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<const SCALE: u64> Debug for FixedPoint256<SCALE>
impl<const SCALE: u64> Debug for FixedPoint256<SCALE>
Source§impl<const SCALE: u64> Default for FixedPoint256<SCALE>
impl<const SCALE: u64> Default for FixedPoint256<SCALE>
Source§fn default() -> FixedPoint256<SCALE>
fn default() -> FixedPoint256<SCALE>
Returns the “default value” for a type. Read more
Source§impl<'de, const SCALE: u64> Deserialize<'de> for FixedPoint256<SCALE>
impl<'de, const SCALE: u64> Deserialize<'de> for FixedPoint256<SCALE>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<const SCALE: u64> FromSql for FixedPoint256<SCALE>
impl<const SCALE: u64> FromSql for FixedPoint256<SCALE>
Source§impl<const SCALE: u64> Hash for FixedPoint256<SCALE>
impl<const SCALE: u64> Hash for FixedPoint256<SCALE>
Source§impl<const SCALE: u64> Ord for FixedPoint256<SCALE>
impl<const SCALE: u64> Ord for FixedPoint256<SCALE>
Source§fn cmp(&self, other: &FixedPoint256<SCALE>) -> Ordering
fn cmp(&self, other: &FixedPoint256<SCALE>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<const SCALE: u64> PartialEq for FixedPoint256<SCALE>
impl<const SCALE: u64> PartialEq for FixedPoint256<SCALE>
Source§impl<const SCALE: u64> PartialOrd for FixedPoint256<SCALE>
impl<const SCALE: u64> PartialOrd for FixedPoint256<SCALE>
Source§impl<const SCALE: u64> Serialize for FixedPoint256<SCALE>
impl<const SCALE: u64> Serialize for FixedPoint256<SCALE>
Source§impl<const SCALE: u64> ToSql for FixedPoint256<SCALE>
impl<const SCALE: u64> ToSql for FixedPoint256<SCALE>
impl<const SCALE: u64> Copy for FixedPoint256<SCALE>
impl<const SCALE: u64> Eq for FixedPoint256<SCALE>
impl<const SCALE: u64> StructuralPartialEq for FixedPoint256<SCALE>
Auto Trait Implementations§
impl<const SCALE: u64> Freeze for FixedPoint256<SCALE>
impl<const SCALE: u64> RefUnwindSafe for FixedPoint256<SCALE>
impl<const SCALE: u64> Send for FixedPoint256<SCALE>
impl<const SCALE: u64> Sync for FixedPoint256<SCALE>
impl<const SCALE: u64> Unpin for FixedPoint256<SCALE>
impl<const SCALE: u64> UnwindSafe for FixedPoint256<SCALE>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.