Crates.io | string |
lib.rs | string |
version | 0.3.0 |
source | src |
created_at | 2017-07-25 19:44:21.614062 |
updated_at | 2021-12-02 23:48:09.987418 |
description | A UTF-8 encoded string with configurable byte storage. |
homepage | https://github.com/carllerche/string |
repository | https://github.com/carllerche/string |
max_upload_size | |
id | 25058 |
size | 13,792 |
A UTF-8 encoded string with configurable byte storage.
To use string
, first add this to your Cargo.toml
:
[dependencies]
string = "0.3.0"
Next, add this to your crate:
extern crate string;
use string::{String, TryFrom};
let s: String<[u8; 2]> = String::try_from([b'h', b'i']).unwrap();
assert_eq!(&s[..], "hi");
See documentation for more details.