Trait Semigroup

Source
pub trait Semigroup: BinaryOp + Associative {
    // Provided method
    fn reduce<I>(&self, iter: I) -> Option<Self::Element>
       where I: IntoIterator<Item = Self::Element> { ... }
}
Expand description

半群

Provided Methods§

Source

fn reduce<I>(&self, iter: I) -> Option<Self::Element>
where I: IntoIterator<Item = Self::Element>,

iterが空のとき、Noneを返す。 そうでないとき、iterの中身を二項演算で畳み込んでSomeで返す。

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§