cell-grid

Crates.iocell-grid
lib.rscell-grid
version
sourcesrc
created_at2023-12-08 18:13:33.004458
updated_at2024-12-11 20:31:51.306892
descriptionA simple 2d grid container
homepage
repositoryhttps://github.com/jcornaz/cell-grid
max_upload_size
id1062307
Cargo.toml error:TOML parse error at line 19, column 1 | 19 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Jonathan Cornaz (jcornaz)

documentation

README

cell-grid

rustc License Crates.io Docs

A simple 2d grid container

use cell_grid::DynamicGrid;

// Create a new empty grid
let mut grid: DynamicGrid<i32> = DynamicGrid::new();

// Push rows
grid.push_row([1, 2]).unwrap();
grid.push_row([3, 4]).unwrap();

// Access by coordinate
assert_eq!(grid.get(0, 0), Some(&1));
assert_eq!(grid.get(1, 0), Some(&2));
assert_eq!(grid.get(0, 1), Some(&3));
assert_eq!(grid.get(1, 1), Some(&4));

// Iterate the content
assert_eq!(grid.cells().copied().collect::<Vec<_>>(), vec![1, 2, 3, 4]);
assert_eq!(grid.rows().collect::<Vec<_>>(), vec![&[1, 2], &[3, 4]]);

Feature flags

  • std: enabled by default. must be disabled to compile to no_std

MSRV

The minimum supported rust version is currently 1.60.

It will be updated when required, and that will not be considered a breaking change (it can happen in a minor version).

Unlicense

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to http://unlicense.org/

Commit count: 56

cargo fmt