Skip to main content

BufferLeaf

Trait BufferLeaf 

Source
pub trait BufferLeaf {
    // Required methods
    fn buffer_array(&self) -> Option<&Array>;
    fn buffer_array_mut(&mut self) -> Option<&mut Array>;
}
Expand description

What a #[tree(buffer)] field may hold: an Array, or an Option<Array> (a leaf when present, as MLX’s optional buffers such as affine-only quantization biases).

Required Methods§

Source

fn buffer_array(&self) -> Option<&Array>

The array, if present.

Source

fn buffer_array_mut(&mut self) -> Option<&mut Array>

The array, mutably, if present.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl BufferLeaf for Option<Array>

Implementors§