erased-cells

Crates.ioerased-cells
lib.rserased-cells
version0.1.1
sourcesrc
created_at2023-12-12 21:41:19.087946
updated_at2023-12-13 19:59:57.429768
descriptionCreate to enable manipulation of heterogeneous values and buffers of Rust primitive numeric types
homepagehttps://s22s.github.io/erased-cells/
repositoryhttps://github.com/s22s/erased-cells/
max_upload_size
id1067085
size92,189
Simeon H.K. Fitch (metasim)

documentation

README

Erased Buffers

Build Status Test Coverage Latest Version Documentation

Enables the use and manipulation of type-erased buffers of Rust primitives.

Please refer to the documentation for details.

Quick Example

use erased_cells::CellBuffer;

fn main() {
    // Create a buffer with u8 values.
    let buf1 = CellBuffer::from(vec![1u8, 2, 3]);
    // Create a buffer with u16 values.
    let buf2 = CellBuffer::from(vec![2u16, 4, 6]);
    // Perform element-wise and scalar math. Division coerces buffer to f64. 
    let result = buf1 / buf2 * 0.5;
    // Expected result:
    assert_eq!(result, vec![0.25, 0.25, 0.25].into());
}

See here in the documentation for additional examples.

Commit count: 12

cargo fmt