| Crates.io | dyn_list |
| lib.rs | dyn_list |
| version | 0.2.1 |
| created_at | 2024-12-13 00:14:21.529978+00 |
| updated_at | 2025-02-12 09:30:19.552072+00 |
| description | A linked list that can hold dynamically sized values in its nodes. |
| homepage | https://github.com/tomBoddaert/dynode |
| repository | https://github.com/tomBoddaert/dynode |
| max_upload_size | |
| id | 1481766 |
| size | 90,467 |
DynListA linked list that can hold dynamically-sized types.
GitHub | docs.rs (latest) | crates.io (latest) | lib.rs
use core::fmt::Debug;
use dyn_list::DynList;
let mut list = DynList::<dyn Debug>::new();
list.push_back_unsize("Hello, World");
list.push_back_unsize(0);
list.push_back_unsize([1, 2, 3, 4]);
println!("{list:?}"); // ["Hello, World!", 0, [1, 2, 3, 4]]
This crate currently only works on the nightly channel.
Each node has a header, containing pointers to the previous and next nodes as well as metadata for the data.
This uses the dynode library, which provides a framework for working with the nodes.
For Sized types, this works exactly like a regular linked list.
alloc - Adds features that require the alloc crate. This includes operations specific to the Global allocator and sets it as the default allocator in generics.std (requires alloc, default) - Adds features that require the std crate. Currently, this adds nothing, but disabling it enables the no_std attribute.This library is still in development and breaking changes may occur.
unsafe blocks.The dynode project, including DynList, is dual-licensed under either the Apache License Version 2.0 or MIT license at your option.