Trait ArrayDivideAndConquer

Source
pub trait ArrayDivideAndConquer<T, const N: usize>: Array + AsSlice<Item = T> {
    // Required methods
    const fn divide_and_conquer<F>(self, reduce: F) -> Option<T>
       where F: FnMut(T, T) -> T;
    const fn divide_and_conquer_ref<'a, F>(&'a self, reduce: F) -> Option<&'a T>
       where F: FnMut(&'a T, &'a T) -> &'a T;
    const fn divide_and_conquer_mut<'a, F>(
        &'a mut self,
        reduce: F,
    ) -> Option<&'a mut T>
       where F: FnMut(&'a mut T, &'a mut T) -> &'a mut T;
    const fn divide_and_conquer_pin_ref<'a, F>(
        self: Pin<&'a Self>,
        reduce: F,
    ) -> Option<Pin<&'a T>>
       where F: FnMut(Pin<&'a T>, Pin<&'a T>) -> Pin<&'a T>;
    const fn divide_and_conquer_pin_mut<'a, F>(
        self: Pin<&'a mut Self>,
        reduce: F,
    ) -> Option<Pin<&'a mut T>>
       where F: FnMut(Pin<&'a mut T>, Pin<&'a mut T>) -> Pin<&'a mut T>;
    const async fn divide_and_conquer_async<F>(self, reduce: F) -> Option<T>
       where F: AsyncFn(T, T) -> T;
    const async fn divide_and_conquer_ref_async<'a, F>(
        &'a self,
        reduce: F,
    ) -> Option<&'a T>
       where F: AsyncFn(&'a T, &'a T) -> &'a T,
             T: 'a;
    const async fn divide_and_conquer_mut_async<'a, F>(
        &'a mut self,
        reduce: F,
    ) -> Option<&'a mut T>
       where F: AsyncFn(&'a mut T, &'a mut T) -> &'a mut T,
             T: 'a;
    const async fn divide_and_conquer_pin_ref_async<'a, F>(
        self: Pin<&'a Self>,
        reduce: F,
    ) -> Option<Pin<&'a T>>
       where F: AsyncFn(Pin<&'a T>, Pin<&'a T>) -> Pin<&'a T>,
             T: 'a;
    const async fn divide_and_conquer_pin_mut_async<'a, F>(
        self: Pin<&'a mut Self>,
        reduce: F,
    ) -> Option<Pin<&'a mut T>>
       where F: AsyncFn(Pin<&'a mut T>, Pin<&'a mut T>) -> Pin<&'a mut T>,
             T: 'a;
}

Required Methods§

Source

const fn divide_and_conquer<F>(self, reduce: F) -> Option<T>
where F: FnMut(T, T) -> T,

Source

const fn divide_and_conquer_ref<'a, F>(&'a self, reduce: F) -> Option<&'a T>
where F: FnMut(&'a T, &'a T) -> &'a T,

Source

const fn divide_and_conquer_mut<'a, F>( &'a mut self, reduce: F, ) -> Option<&'a mut T>

Source

const fn divide_and_conquer_pin_ref<'a, F>( self: Pin<&'a Self>, reduce: F, ) -> Option<Pin<&'a T>>
where F: FnMut(Pin<&'a T>, Pin<&'a T>) -> Pin<&'a T>,

Source

const fn divide_and_conquer_pin_mut<'a, F>( self: Pin<&'a mut Self>, reduce: F, ) -> Option<Pin<&'a mut T>>

Source

const async fn divide_and_conquer_async<F>(self, reduce: F) -> Option<T>
where F: AsyncFn(T, T) -> T,

Source

const async fn divide_and_conquer_ref_async<'a, F>( &'a self, reduce: F, ) -> Option<&'a T>
where F: AsyncFn(&'a T, &'a T) -> &'a T, T: 'a,

Source

const async fn divide_and_conquer_mut_async<'a, F>( &'a mut self, reduce: F, ) -> Option<&'a mut T>
where F: AsyncFn(&'a mut T, &'a mut T) -> &'a mut T, T: 'a,

Source

const async fn divide_and_conquer_pin_ref_async<'a, F>( self: Pin<&'a Self>, reduce: F, ) -> Option<Pin<&'a T>>
where F: AsyncFn(Pin<&'a T>, Pin<&'a T>) -> Pin<&'a T>, T: 'a,

Source

const async fn divide_and_conquer_pin_mut_async<'a, F>( self: Pin<&'a mut Self>, reduce: F, ) -> Option<Pin<&'a mut T>>
where F: AsyncFn(Pin<&'a mut T>, Pin<&'a mut T>) -> Pin<&'a mut T>, T: 'a,

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.

Implementations on Foreign Types§

Source§

impl<T, const N: usize> ArrayDivideAndConquer<T, N> for [T; N]

Source§

fn divide_and_conquer<F>(self, reduce: F) -> Option<T>
where F: FnMut(T, T) -> T,

Source§

fn divide_and_conquer_ref<'a, F>(&'a self, reduce: F) -> Option<&'a T>
where F: FnMut(&'a T, &'a T) -> &'a T,

Source§

fn divide_and_conquer_mut<'a, F>(&'a mut self, reduce: F) -> Option<&'a mut T>

Source§

fn divide_and_conquer_pin_ref<'a, F>( self: Pin<&'a Self>, reduce: F, ) -> Option<Pin<&'a T>>
where F: FnMut(Pin<&'a T>, Pin<&'a T>) -> Pin<&'a T>,

Source§

fn divide_and_conquer_pin_mut<'a, F>( self: Pin<&'a mut Self>, reduce: F, ) -> Option<Pin<&'a mut T>>

Source§

async fn divide_and_conquer_async<F>(self, reduce: F) -> Option<T>
where F: AsyncFn(T, T) -> T,

Source§

async fn divide_and_conquer_ref_async<'a, F>( &'a self, reduce: F, ) -> Option<&'a T>
where F: AsyncFn(&'a T, &'a T) -> &'a T, T: 'a,

Source§

async fn divide_and_conquer_mut_async<'a, F>( &'a mut self, reduce: F, ) -> Option<&'a mut T>
where F: AsyncFn(&'a mut T, &'a mut T) -> &'a mut T, T: 'a,

Source§

async fn divide_and_conquer_pin_ref_async<'a, F>( self: Pin<&'a Self>, reduce: F, ) -> Option<Pin<&'a T>>
where F: AsyncFn(Pin<&'a T>, Pin<&'a T>) -> Pin<&'a T>, T: 'a,

Source§

async fn divide_and_conquer_pin_mut_async<'a, F>( self: Pin<&'a mut Self>, reduce: F, ) -> Option<Pin<&'a mut T>>
where F: AsyncFn(Pin<&'a mut T>, Pin<&'a mut T>) -> Pin<&'a mut T>, T: 'a,

Implementors§