Trait arithmetic_typing::arith::ObjectSafeConstraint

source ·
pub trait ObjectSafeConstraint<Prim: PrimitiveType>: Constraint<Prim> { }
Expand description

Marker trait for object-safe constraints, i.e., constraints that can be included into a DynConstraints.

Object safety is similar to this notion in Rust. For a constraint C to be object-safe, it should be the case that dyn C (the untagged union of all types implementing C) implements C. As an example, this is the case for Linearity, but is not the case for Ops. Indeed, Ops requires the type to be addable to itself, which would be impossible for dyn Ops.

Implementors§