pub trait ScalarSet:
Clone
+ Debug
+ 'static {
type Tag: Copy + Eq + Debug + 'static;
const TAGS: &'static [Self::Tag];
// Required methods
fn tag(&self) -> Self::Tag;
fn promote(lhs: Self::Tag, rhs: Self::Tag) -> Self::Tag;
}Expand description
A closed set of scalar types carried by one tensor value type.
A set is represented by one value type: the default set’s payload is opaque
and a downstream set defines its own value enum, and ScalarSet::tag
reports which member a value currently holds.
§Examples
use tenferro_tensor::{DefaultScalars, ScalarSet};
let value = DefaultScalars::from_vec_col_major(vec![1], vec![1.0_f64])?;
assert_eq!(value.tag(), tenferro_tensor_core::DType::F64);Required Associated Constants§
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".