Struct Accumulate

Source
pub struct Accumulate<M>
where M: Monoid,
{ /* private fields */ }
Expand description

Accumlated data

Implementations§

Source§

impl<M> Accumulate<M>
where M: Monoid,

Source

pub fn accumulate(&self, k: usize) -> M::T

Return fold of [0, k)

Source§

impl<M> Accumulate<M>
where M: Group,

Source

pub fn fold<R>(&self, range: R) -> M::T
where R: RangeBounds<usize>,

Return fold of range

Trait Implementations§

Source§

impl<M> Debug for Accumulate<M>
where M: Monoid, M::T: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<M> FromIterator<<M as Magma>::T> for Accumulate<M>
where M: Monoid,

Source§

fn from_iter<T>(iter: T) -> Self
where T: IntoIterator<Item = M::T>,

Creates a value from an iterator. Read more

Auto Trait Implementations§

§

impl<M> Freeze for Accumulate<M>

§

impl<M> RefUnwindSafe for Accumulate<M>
where <M as Magma>::T: RefUnwindSafe,

§

impl<M> Send for Accumulate<M>
where <M as Magma>::T: Send,

§

impl<M> Sync for Accumulate<M>
where <M as Magma>::T: Sync,

§

impl<M> Unpin for Accumulate<M>
where <M as Magma>::T: Unpin,

§

impl<M> UnwindSafe for Accumulate<M>
where <M as Magma>::T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.