velect

Crates.iovelect
lib.rsvelect
version0.2.0
sourcesrc
created_at2023-12-26 06:58:38.34867
updated_at2024-01-10 16:56:49.07299
descriptionA Vec with item / index selection
homepage
repositoryhttps://github.com/CerulanLumina/velect
max_upload_size
id1080668
size55,377
Cerulan Lumina (CerulanLumina)

documentation

README

Velect: A Vec with item selection

velect is a Rust crate that provides a vector-like type with item selection functionality - which here means either zero or one index from the vector is "selected" and can be retrieved easily without needing to manually track the index of the selected item

Velect does the index tracking for you - it maintains the selected index, updating it whenever a mutation necessitates it.

Interface

Velect implements Deref<Target = Vec<_>>, which allows you to use all non-mutating functions from Vec as well as [T] transparently. Mutating functions (those taking &mut self as a parameter) are reimplemented with compatible interfaces, helping make Velect a close-to-drop-in replacement for Vec.

Additionally, Velect<T> also implements many of the same traits as Vec<T>.

License

Velect is licensed under MPL 2.0 which allows you to use it in your project as a library for almost any use case with proper attribution. Modifications of Velect should be licensed under a similar license.

Contributing

I welcome PRs and issue creation. When contributing code you agree to assign copyright of the code you contribute to the project in the understanding it will remain licensed under MPL 2.0 or another similarly weak or stronger copyleft license.

Commit count: 12

cargo fmt