Trait Semilattice

Source
pub trait Semilattice {
    type Val: Clone;

    // Required methods
    fn id() -> Self::Val;
    fn op(x: &Self::Val, y: &Self::Val) -> Self::Val;
}
Expand description

半束

  • 単位元をもち,可環かつ冪等な2項演算

Required Associated Types§

Source

type Val: Clone

元の型

Required Methods§

Source

fn id() -> Self::Val

単位元

Source

fn op(x: &Self::Val, y: &Self::Val) -> Self::Val

可換かつ冪等な二項演算

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.

Implementors§

Source§

impl<T: Ord + Bounded + Clone> Semilattice for Max<T>

Source§

type Val = T

Source§

impl<T: Ord + Bounded + Clone> Semilattice for Min<T>

Source§

type Val = T

Source§

impl<T: Zero + Rem<T>> Semilattice for GCD<T>