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§
fn clone_boxed(&self) -> Box<dyn DecimalLike>
fn dyn_eq(&self, other: &dyn DecimalLike) -> bool
fn as_any(&self) -> &dyn Any
Trait Implementations§
Source§impl Clone for Box<dyn DecimalLike>
impl Clone for Box<dyn DecimalLike>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".