pub trait Monoid {
type Val: Clone;
// Required methods
fn e() -> Self::Val;
fn op(left: &Self::Val, right: &Self::Val) -> Self::Val;
}Expand description
モノイド
Monoid::Val: データの型 $S$Monoid::e: 単位元を返す関数 $\varnothing \to S$Monoid::op: 演算 $S\times S \to S$
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.