Trait Action

Source
pub trait Action: Debug + Clone {
    type Target: Clone;

    // Required methods
    fn id_action() -> Self;
    fn composition(&mut self, rhs: &Self);
    fn apply(&self, target: &mut Self::Target);
}
Expand description

作用
作用自体もモノイドであることを要求
作用素を合成させてから作用させるのと、作用素を一つ一つ作用させる結果が同じであることを要求

Required Associated Types§

Source

type Target: Clone

作用の対象

Required Methods§

Source

fn id_action() -> Self

恒等写像

Source

fn composition(&mut self, rhs: &Self)

作用の合成(selfが先、rhsが後)
(atcoder libraryとは作用の順が逆なので注意)

Source

fn apply(&self, target: &mut Self::Target)

作用の適用

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§