3 releases

0.0.3 Nov 29, 2024
0.0.2 Nov 29, 2024
0.0.1 Nov 14, 2024

#889 in Memory management

Download history 149/week @ 2025-10-16 138/week @ 2025-10-23 100/week @ 2025-10-30 85/week @ 2025-11-06 131/week @ 2025-11-13 116/week @ 2025-11-20 134/week @ 2025-11-27 100/week @ 2025-12-04 81/week @ 2025-12-11 109/week @ 2025-12-18 109/week @ 2025-12-25 107/week @ 2026-01-01 36/week @ 2026-01-08 129/week @ 2026-01-15 101/week @ 2026-01-22 94/week @ 2026-01-29

387 downloads per month
Used in 45 crates (3 directly)

MIT license

7KB
93 lines

A small string type with fixed capacity stored on the stack

Examples

use fixstr::FixStr;

// Create a FixStr with capacity of 16 octets
let tiny: FixStr<16> = FixStr::new("Hello").unwrap();
assert_eq!(tiny.as_str(), "Hello");
assert_eq!(tiny.capacity(), 16);

// FixStr implements common traits
let tiny2: FixStr<16> = "World".try_into().unwrap();
let message: String = tiny2.into();

📦 FixStr

A zero-allocation, fixed-capacity string type that lives entirely on the stack.

Crates.io Documentation

🚀 Features

  • ✨ Zero heap allocations
  • 📏 Configurable fixed capacity
  • 🔒 Guaranteed UTF-8 validity
  • 🎯 Perfect for small strings
  • 🔄 Implements common traits (Clone, Copy, Debug, etc.)

📥 Installation

Add this to your Cargo.toml:

[dependencies]
fixstr = "0.0.1"

📜 License This project is licensed under the MIT License - see the LICENSE file for details.

No runtime deps