Skip to main content

Monoid

Trait Monoid 

Source
pub trait Monoid:
    Copy
    + PartialEq
    + Debug {
    const IDENTITY: Self;

    // Required methods
    fn combine(self, other: Self) -> Self;
    fn to_acc_bytes(&self) -> [u8; 64];
    fn from_acc_bytes(b: &[u8; 64]) -> Self;
}

Required Associated Constants§

Source

const IDENTITY: Self

Required Methods§

Source

fn combine(self, other: Self) -> Self

Source

fn to_acc_bytes(&self) -> [u8; 64]

Serialize into the 64-byte acc window (LE, zero-pad the tail).

Source

fn from_acc_bytes(b: &[u8; 64]) -> Self

Deserialize from the 64-byte acc window. Must round-trip to_acc_bytes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§