Crate | Type | Owned | Sync |
Send |
Mutable | Inner Mutability | Description |
---|---|---|---|---|---|---|---|
bytes |
Bytes |
❌* | ✔️ | ✔️ | ❌ | ❌ | Provides zero-copy sharing of byte buffers. A group of Bytes /BytesMut can share ownership of the underlying buffer similar to an Arc . |
bytes |
BytesMut |
✔️* | ✔️ | ✔️ | ✔️ | ❌ | Similar to Bytes in functionality, but for exclusive ownership of a portion of a buffer. |
smallvec |
SmallVec<[T;N]> |
✔️ | ❔ | ❔ | ✔️ | ❌ | Functions the same as a regular Vec<T> , but stores the first N elements on the stack before allocating space on the heap. |
generic-array |
GenericArray<T, N> |
✔️ | ❔ | ❔ | ✔️ | ❌ | An array of T whos length is determined by a length placeholder type (Ex: U0 , U1 , U2 , etc). A useful alternative to const generics which can allow for better control of the length via traits. Once const generic support improves, this might become deprecated. |
(TODO, currenty missing a lot of stuff)
Key | |
---|---|
✔️ | Yes, always |
❔ | Dependent on contents |
❌ | No |