Skip to main content

Decimal

Struct Decimal 

Source
pub struct Decimal {
    pub unscaled: BigInt,
    pub scale: i32,
}

Fields§

§unscaled: BigInt§scale: i32

Implementations§

Source§

impl Decimal

Source

pub fn new(unscaled: BigInt, scale: i32) -> Decimal

Trait Implementations§

Source§

impl Clone for Decimal

Source§

fn clone(&self) -> Decimal

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Decimal

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for Decimal

Source§

fn default() -> Decimal

Returns the “default value” for a type. Read more
Source§

impl ForyDefault for Decimal

Source§

fn fory_default() -> Decimal

Creates a default value for this type. Read more
Source§

impl Hash for Decimal

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Decimal

Source§

fn eq(&self, other: &Decimal) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serializer for Decimal

Source§

fn fory_write_data(&self, context: &mut WriteContext<'_>) -> Result<(), Error>

[USER IMPLEMENTATION REQUIRED] Serialize the type’s data to the buffer. Read more
Source§

fn fory_read_data(context: &mut ReadContext<'_>) -> Result<Decimal, Error>

[USER IMPLEMENTATION REQUIRED] Deserialize the type’s data from the buffer. Read more
Source§

fn fory_get_type_id(_: &TypeResolver) -> Result<TypeId, Error>

Get the registered type ID from the type resolver. Read more
Source§

fn fory_type_id_dyn(&self, _: &TypeResolver) -> Result<TypeId, Error>

[USER IMPLEMENTATION REQUIRED] Get the runtime type ID for this instance. Read more
Source§

fn fory_static_type_id() -> TypeId

Get the static Fory type ID for this type. Read more
Source§

fn as_any(&self) -> &(dyn Any + 'static)

[USER IMPLEMENTATION REQUIRED] Downcast to &dyn Any for dynamic type checking. Read more
Source§

fn fory_write_type_info(context: &mut WriteContext<'_>) -> Result<(), Error>

Write type metadata to the buffer. Read more
Source§

fn fory_read_type_info(context: &mut ReadContext<'_>) -> Result<(), Error>

Read and validate type metadata from the buffer. Read more
Source§

fn fory_write( &self, context: &mut WriteContext<'_>, ref_mode: RefMode, write_type_info: bool, has_generics: bool, ) -> Result<(), Error>
where Self: Sized,

Entry point for serialization. Read more
Source§

fn fory_write_data_generic( &self, context: &mut WriteContext<'_>, has_generics: bool, ) -> Result<(), Error>

Write data with generic type parameter support. Read more
Source§

fn fory_read( context: &mut ReadContext<'_>, ref_mode: RefMode, read_type_info: bool, ) -> Result<Self, Error>
where Self: Sized + ForyDefault,

Entry point for deserialization. Read more
Source§

fn fory_read_with_type_info( context: &mut ReadContext<'_>, ref_mode: RefMode, type_info: Rc<TypeInfo>, ) -> Result<Self, Error>
where Self: Sized + ForyDefault,

Deserialize with pre-read type information. Read more
Source§

fn fory_is_option() -> bool
where Self: Sized,

Check if this type is Option<T>. Read more
Source§

fn fory_is_none(&self) -> bool

Check if this instance represents a None value. Read more
Source§

fn fory_is_polymorphic() -> bool
where Self: Sized,

Check if this type supports polymorphic serialization. Read more
Source§

fn fory_is_shared_ref() -> bool
where Self: Sized,

Check if this type is a shared reference (Rc/Arc). Read more
Source§

fn fory_is_wrapper_type() -> bool
where Self: Sized,

Source§

fn fory_get_type_info( type_resolver: &TypeResolver, ) -> Result<Rc<TypeInfo>, Error>
where Self: Sized,

Source§

fn fory_concrete_type_id(&self) -> TypeId

Get Rust’s std::any::TypeId for this instance. Read more
Source§

fn fory_reserved_space() -> usize
where Self: Sized,

Hint for buffer pre-allocation size. Read more
Source§

impl Eq for Decimal

Source§

impl StructuralPartialEq for Decimal

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.