Skip to main content

ElementSum

Trait ElementSum 

Source
pub trait ElementSum {
    type Output;

    // Required methods
    fn to_element_sum(&self) -> Self::Output;
    fn into_element_sum(self) -> Self::Output;
}
Expand description

Calculates the sum of the elements of a vector.

Unlike Sum, which adds vectors to each other, this adds up the elements of one vector, producing a single element.

Required Associated Types§

Required Methods§

Source

fn to_element_sum(&self) -> Self::Output

Source

fn into_element_sum(self) -> Self::Output

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§