File: README.md

package info (click to toggle)
rust-string 0.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 108 kB
  • sloc: makefile: 4
file content (30 lines) | stat: -rw-r--r-- 851 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# String

A UTF-8 encoded string with configurable byte storage.

[![Build Status](https://travis-ci.org/carllerche/string.svg?branch=master)](https://travis-ci.org/carllerche/string)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![Crates.io](https://img.shields.io/crates/v/string.svg?maxAge=2592000)](https://crates.io/crates/string)
[![Documentation](https://docs.rs/string/badge.svg)](https://docs.rs/string/0.2.1/string/)

## Usage

To use `string`, first add this to your `Cargo.toml`:

```toml
[dependencies]
string = "0.2.1"
```

Next, add this to your crate:

```rust
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](https://docs.rs/string) for more details.