Skip to main content

DecimalLike

Trait DecimalLike 

Source
pub trait DecimalLike:
    Debug
    + Display
    + Send
    + Sync {
    // Required methods
    fn clone_boxed(&self) -> Box<dyn DecimalLike>;
    fn dyn_eq(&self, other: &dyn DecimalLike) -> bool;
    fn as_any(&self) -> &dyn Any;
}
Expand description

Object-safe counterpart to DecimalValue. Debug/Display are automatically implemented for dyn DecimalLike (supertrait methods are always available on a trait object); Clone/PartialEq are not object-safe (Self: Sized), so this trait provides hand-rolled equivalents (clone_boxed, dyn_eq) that Box<dyn DecimalLike>’s own Clone/PartialEq impls (below) delegate to.

Required Methods§

Source

fn clone_boxed(&self) -> Box<dyn DecimalLike>

Source

fn dyn_eq(&self, other: &dyn DecimalLike) -> bool

Source

fn as_any(&self) -> &dyn Any

Trait Implementations§

Source§

impl Clone for Box<dyn DecimalLike>

Source§

fn clone(&self) -> Self

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 PartialEq for Box<dyn DecimalLike>

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T> DecimalLike for T
where T: DecimalValue,