mlx_rs::ops::indexing

Trait TryIndexMutOp

Source
pub trait TryIndexMutOp<Idx, Val> {
    // Required method
    fn try_index_mut_device(
        &mut self,
        i: Idx,
        val: Val,
        stream: impl AsRef<Stream>,
    ) -> Result<()>;

    // Provided method
    fn try_index_mut(&mut self, i: Idx, val: Val) -> Result<()> { ... }
}
Expand description

Trait for custom mutable indexing operations.

Required Methods§

Source

fn try_index_mut_device( &mut self, i: Idx, val: Val, stream: impl AsRef<Stream>, ) -> Result<()>

Try to index the array with the given index and set the value.

Provided Methods§

Source

fn try_index_mut(&mut self, i: Idx, val: Val) -> Result<()>

Try to index the array with the given index and set the value.

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, '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, Val> TryIndexMutOp<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P), Val> 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>, Val: AsRef<Array>,

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, Val> TryIndexMutOp<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O), Val> 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>, Val: AsRef<Array>,

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, Val> TryIndexMutOp<(A, B, C, D, E, F, G, H, I, J, K, L, M, N), Val> 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>, Val: AsRef<Array>,

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, Val> TryIndexMutOp<(A, B, C, D, E, F, G, H, I, J, K, L, M), Val> 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>, Val: AsRef<Array>,

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, Val> TryIndexMutOp<(A, B, C, D, E, F, G, H, I, J, K, L), Val> 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>, Val: AsRef<Array>,

Source§

impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, A, B, C, D, E, F, G, H, I, J, K, Val> TryIndexMutOp<(A, B, C, D, E, F, G, H, I, J, K), Val> 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>, Val: AsRef<Array>,

Source§

impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, A, B, C, D, E, F, G, H, I, J, Val> TryIndexMutOp<(A, B, C, D, E, F, G, H, I, J), Val> 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>, Val: AsRef<Array>,

Source§

impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, A, B, C, D, E, F, G, H, I, Val> TryIndexMutOp<(A, B, C, D, E, F, G, H, I), Val> 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>, Val: AsRef<Array>,

Source§

impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, A, B, C, D, E, F, G, H, Val> TryIndexMutOp<(A, B, C, D, E, F, G, H), Val> 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>, Val: AsRef<Array>,

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<'a, A, Val> TryIndexMutOp<(A,), Val> for Array
where A: ArrayIndex<'a>, Val: AsRef<Array>,

Source§

impl<'a, Val> TryIndexMutOp<&'a [ArrayIndexOp<'a>], Val> for Array
where Val: AsRef<Array>,

Source§

impl<A, Val> TryIndexMutOp<A, Val> for Array
where for<'a> A: ArrayIndex<'a>, Val: AsRef<Array>,