Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tomboddaert/dyn-slice
An implementation for a &dyn [Trait] -like reference
https://github.com/tomboddaert/dyn-slice
data-structures rust
Last synced: about 2 months ago
JSON representation
An implementation for a &dyn [Trait] -like reference
- Host: GitHub
- URL: https://github.com/tomboddaert/dyn-slice
- Owner: tomBoddaert
- Created: 2023-07-11T18:11:24.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-07T21:47:21.000Z (8 months ago)
- Last Synced: 2024-08-09T21:28:23.642Z (5 months ago)
- Topics: data-structures, rust
- Language: Rust
- Homepage: https://crates.io/crates/dyn-slice
- Size: 118 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Rust](https://github.com/tomBoddaert/dyn-slice/actions/workflows/rust.yml/badge.svg?event=push)](https://github.com/tomBoddaert/dyn-slice/actions/workflows/rust.yml)
# Dyn-Slice
An implementation of a `&dyn [Trait]`-like reference, inspired by a [Reddit thread](https://www.reddit.com/r/rust/comments/14i08gz/dyn_slices).
`dyn-slice`s are slices of trait objects. Indexing into one yields a trait object reference. The vtable pointer is only stored once.
```sh
cargo add dyn-slice
```[Latest documentation](https://docs.rs/dyn-slice/latest/dyn_slice/)
[Examples](/examples/)[dyn-slice on crates.io](https://crates.io/crates/dyn-slice)
[dyn-slice on lib.rs](https://lib.rs/crates/dyn-slice)
[dyn-slice on GitHub](https://github.com/tomBoddaert/dyn-slice)## Warning
This was originally just a proof of concept and may has some bugs, so it may be best not to use it in production (or any important) code.
With that said, feel free to use it in code that does not have to be reliable and to open an issue if you find any bugs.
## License
[Dyn-Slice](https://github.com/tomBoddaert/dyn-slice) is dual-licensed under either the Apache License Version 2.0 or MIT license at your option.