https://github.com/ohsayan/rust-fallible-collections
Traits for fallible access to Rust's collections
https://github.com/ohsayan/rust-fallible-collections
Last synced: 5 months ago
JSON representation
Traits for fallible access to Rust's collections
- Host: GitHub
- URL: https://github.com/ohsayan/rust-fallible-collections
- Owner: ohsayan
- License: other
- Created: 2020-10-04T04:12:46.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2020-10-04T05:29:29.000Z (about 5 years ago)
- Last Synced: 2025-05-13T00:52:25.117Z (5 months ago)
- Language: Rust
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fallible access trait for Rust's collections
> ### **Status**: Experimental
## Introduction
This crate provides the `FallibleSequence` trait, which can be used for standardization of the methods provided by sequential data structures like `Vec` , `VecDeque` and `String` .
## Motivation
While I was working on implementing snapshots in [TerrabaseDB](https://github.com/terrabasedb/terrabasedb), I needed to implement a simple queue data structure, which required a 'non-panicky' implementation of `Vec::remove(idx)` . This prompted me to create [this PR](https://github.com/rust-lang/rust/pull/77480). However, from the discussion in the linked PR, it was clear that there was a lack of standardization in the collections when it came to `get()` , `remove()` , `insert()` , etc. This crate exists as a [_testbed_](https://en.wikipedia.org/wiki/Testbed) for attempts on standardizing these methods.
## Contributions
Unless you explicitly state otherwise, any contribution intentionally by you, shall be dual-licensed under Apache-2.0 and MIT, without any additional terms or conditions.
## License
This project is dual-licensed under the [Apache-2.0](./LICENSE-APACHE) and [MIT](./LICENSE-MIT) licenses.