pub trait Scalar:
Copy
+ Send
+ Sync
+ 'static {
const DOMAIN: ScalarDomain;
}Expand description
A scalar the host tensor data model can store and move.
This contract carries only storage and representation properties. It does not require arithmetic, a dtype tag, or any operation support, so declaring a scalar never forces unrelated implementations.
§Examples
use tenferro_tensor_core::{Scalar, ScalarDomain};
fn domain_of<T: Scalar>() -> ScalarDomain {
T::DOMAIN
}
assert_eq!(domain_of::<i32>(), ScalarDomain::Field);Required Associated Constants§
Sourceconst DOMAIN: ScalarDomain
const DOMAIN: ScalarDomain
Algebra of this scalar’s ordinary arithmetic.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".