Skip to main content

ArrayLike

Trait ArrayLike 

Source
pub trait ArrayLike<B: Backend, T: Element>: Sized {
    // Required method
    fn into_array(self) -> Array<B, T>;

    // Provided method
    fn with_array<R>(self, f: impl FnOnce(&Array<B, T>) -> R) -> R { ... }
}
Expand description

Something that can be an operand of an array operation: an array, a scalar, or a Rust value.

Required Methods§

Source

fn into_array(self) -> Array<B, T>

Converts to an array.

Provided Methods§

Source

fn with_array<R>(self, f: impl FnOnce(&Array<B, T>) -> R) -> R

Calls f with the array, without copying a borrowed array.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<B: Backend, T: Element> ArrayLike<B, T> for &Array<B, T>

Source§

impl<B: Backend, T: Element> ArrayLike<B, T> for Array<B, T>

Source§

impl<B: Backend, T: Element> ArrayLike<B, T> for Scalar<B, T>

Source§

impl<B: Backend, T: Element> ArrayLike<B, T> for T