mlx_rs::ops::indexing

Trait TryIndexOp

Source
pub trait TryIndexOp<Idx> {
    // Required method
    fn try_index_device(
        &self,
        i: Idx,
        stream: impl AsRef<Stream>,
    ) -> Result<Array>;

    // Provided method
    fn try_index(&self, i: Idx) -> Result<Array> { ... }
}
Expand description

Trait for custom indexing operations.

Out of bounds indexing is allowed and wouldn’t return an error.

Required Methods§

Source

fn try_index_device(&self, i: Idx, stream: impl AsRef<Stream>) -> Result<Array>

Try to index the array with the given index.

Provided Methods§

Source

fn try_index(&self, i: Idx) -> Result<Array>

Try to index the array with the given index.

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.

Implementors§

Source§

impl<'a> TryIndexOp<&'a [ArrayIndexOp<'a>]> for Array

Source§

impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n, 'o, 'p, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P> TryIndexOp<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)> for Array
where A: ArrayIndex<'a>, B: ArrayIndex<'b>, C: ArrayIndex<'c>, D: ArrayIndex<'d>, E: ArrayIndex<'e>, F: ArrayIndex<'f>, G: ArrayIndex<'g>, H: ArrayIndex<'h>, I: ArrayIndex<'i>, J: ArrayIndex<'j>, K: ArrayIndex<'k>, L: ArrayIndex<'l>, M: ArrayIndex<'m>, N: ArrayIndex<'n>, O: ArrayIndex<'o>, P: ArrayIndex<'p>,

Source§

impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n, 'o, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> TryIndexOp<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)> for Array
where A: ArrayIndex<'a>, B: ArrayIndex<'b>, C: ArrayIndex<'c>, D: ArrayIndex<'d>, E: ArrayIndex<'e>, F: ArrayIndex<'f>, G: ArrayIndex<'g>, H: ArrayIndex<'h>, I: ArrayIndex<'i>, J: ArrayIndex<'j>, K: ArrayIndex<'k>, L: ArrayIndex<'l>, M: ArrayIndex<'m>, N: ArrayIndex<'n>, O: ArrayIndex<'o>,

Source§

impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n, A, B, C, D, E, F, G, H, I, J, K, L, M, N> TryIndexOp<(A, B, C, D, E, F, G, H, I, J, K, L, M, N)> for Array
where A: ArrayIndex<'a>, B: ArrayIndex<'b>, C: ArrayIndex<'c>, D: ArrayIndex<'d>, E: ArrayIndex<'e>, F: ArrayIndex<'f>, G: ArrayIndex<'g>, H: ArrayIndex<'h>, I: ArrayIndex<'i>, J: ArrayIndex<'j>, K: ArrayIndex<'k>, L: ArrayIndex<'l>, M: ArrayIndex<'m>, N: ArrayIndex<'n>,

Source§

impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, A, B, C, D, E, F, G, H, I, J, K, L, M> TryIndexOp<(A, B, C, D, E, F, G, H, I, J, K, L, M)> for Array
where A: ArrayIndex<'a>, B: ArrayIndex<'b>, C: ArrayIndex<'c>, D: ArrayIndex<'d>, E: ArrayIndex<'e>, F: ArrayIndex<'f>, G: ArrayIndex<'g>, H: ArrayIndex<'h>, I: ArrayIndex<'i>, J: ArrayIndex<'j>, K: ArrayIndex<'k>, L: ArrayIndex<'l>, M: ArrayIndex<'m>,

Source§

impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, A, B, C, D, E, F, G, H, I, J, K, L> TryIndexOp<(A, B, C, D, E, F, G, H, I, J, K, L)> for Array
where A: ArrayIndex<'a>, B: ArrayIndex<'b>, C: ArrayIndex<'c>, D: ArrayIndex<'d>, E: ArrayIndex<'e>, F: ArrayIndex<'f>, G: ArrayIndex<'g>, H: ArrayIndex<'h>, I: ArrayIndex<'i>, J: ArrayIndex<'j>, K: ArrayIndex<'k>, L: ArrayIndex<'l>,

Source§

impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, A, B, C, D, E, F, G, H, I, J, K> TryIndexOp<(A, B, C, D, E, F, G, H, I, J, K)> for Array
where A: ArrayIndex<'a>, B: ArrayIndex<'b>, C: ArrayIndex<'c>, D: ArrayIndex<'d>, E: ArrayIndex<'e>, F: ArrayIndex<'f>, G: ArrayIndex<'g>, H: ArrayIndex<'h>, I: ArrayIndex<'i>, J: ArrayIndex<'j>, K: ArrayIndex<'k>,

Source§

impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, A, B, C, D, E, F, G, H, I, J> TryIndexOp<(A, B, C, D, E, F, G, H, I, J)> for Array
where A: ArrayIndex<'a>, B: ArrayIndex<'b>, C: ArrayIndex<'c>, D: ArrayIndex<'d>, E: ArrayIndex<'e>, F: ArrayIndex<'f>, G: ArrayIndex<'g>, H: ArrayIndex<'h>, I: ArrayIndex<'i>, J: ArrayIndex<'j>,

Source§

impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, A, B, C, D, E, F, G, H, I> TryIndexOp<(A, B, C, D, E, F, G, H, I)> for Array
where A: ArrayIndex<'a>, B: ArrayIndex<'b>, C: ArrayIndex<'c>, D: ArrayIndex<'d>, E: ArrayIndex<'e>, F: ArrayIndex<'f>, G: ArrayIndex<'g>, H: ArrayIndex<'h>, I: ArrayIndex<'i>,

Source§

impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, A, B, C, D, E, F, G, H> TryIndexOp<(A, B, C, D, E, F, G, H)> for Array
where A: ArrayIndex<'a>, B: ArrayIndex<'b>, C: ArrayIndex<'c>, D: ArrayIndex<'d>, E: ArrayIndex<'e>, F: ArrayIndex<'f>, G: ArrayIndex<'g>, H: ArrayIndex<'h>,

Source§

impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, A, B, C, D, E, F, G> TryIndexOp<(A, B, C, D, E, F, G)> for Array
where A: ArrayIndex<'a>, B: ArrayIndex<'b>, C: ArrayIndex<'c>, D: ArrayIndex<'d>, E: ArrayIndex<'e>, F: ArrayIndex<'f>, G: ArrayIndex<'g>,

Source§

impl<'a, 'b, 'c, 'd, 'e, 'f, A, B, C, D, E, F> TryIndexOp<(A, B, C, D, E, F)> for Array
where A: ArrayIndex<'a>, B: ArrayIndex<'b>, C: ArrayIndex<'c>, D: ArrayIndex<'d>, E: ArrayIndex<'e>, F: ArrayIndex<'f>,

Source§

impl<'a, 'b, 'c, 'd, 'e, A, B, C, D, E> TryIndexOp<(A, B, C, D, E)> for Array
where A: ArrayIndex<'a>, B: ArrayIndex<'b>, C: ArrayIndex<'c>, D: ArrayIndex<'d>, E: ArrayIndex<'e>,

Source§

impl<'a, 'b, 'c, 'd, A, B, C, D> TryIndexOp<(A, B, C, D)> for Array
where A: ArrayIndex<'a>, B: ArrayIndex<'b>, C: ArrayIndex<'c>, D: ArrayIndex<'d>,

Source§

impl<'a, 'b, 'c, A, B, C> TryIndexOp<(A, B, C)> for Array
where A: ArrayIndex<'a>, B: ArrayIndex<'b>, C: ArrayIndex<'c>,

Source§

impl<'a, 'b, A, B> TryIndexOp<(A, B)> for Array
where A: ArrayIndex<'a>, B: ArrayIndex<'b>,

Source§

impl<'a, A> TryIndexOp<(A,)> for Array
where A: ArrayIndex<'a>,

Source§

impl<'a, T> TryIndexOp<T> for Array
where T: ArrayIndex<'a>,