Skip to main content

Consumer

Trait Consumer 

Source
pub trait Consumer: Sized {
    type Repr;
    type Target;

    // Required methods
    fn init(&self, value: Self::Repr) -> Self::Target;
    fn consume(&self, target: &mut Self::Target, value: Self::Repr);
}
Expand description

Responsible for consuming the scalar value and modifying itself accordingly.

Required Associated Types§

Source

type Repr

Defines the scalar representation type.

Source

type Target

Required Methods§

Source

fn init(&self, value: Self::Repr) -> Self::Target

Source

fn consume(&self, target: &mut Self::Target, value: Self::Repr)

Consume or accumulate the new value into itself.

May consume one or more entries.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§