]> git.proxmox.com Git - rustc.git/blob - vendor/void/README.md
New upstream version 1.36.0+dfsg1
[rustc.git] / vendor / void / README.md
1 # Void
2
3 > The uninhabited void type for use in statically impossible cases.
4
5 ## [Documentation](https://crates.fyi/crates/void/1.0.1)
6
7 The uninhabited type, `enum Void { }` is useful in dealing with cases you
8 know to be impossible. For instance, if you are implementing a trait which
9 allows for error checking, but your case always succeeds, you can mark the
10 error case or type as `Void`, signaling to the compiler it can never happen.
11
12 This crate also comes packed with a few traits offering extension methods to
13 `Result<T, Void>` and `Result<Void, T>`.
14
15 ## Usage
16
17 Use the crates.io repository; add this to your `Cargo.toml` along
18 with the rest of your dependencies:
19
20 ```toml
21 [dependencies]
22 void = "1"
23 ```
24
25 Then, use `Void` in your crate:
26
27 ```rust
28 extern crate void;
29 use void::Void;
30 ```
31
32 ## Author
33
34 [Jonathan Reem](https://medium.com/@jreem) is the primary author and maintainer of void.
35
36 ## License
37
38 MIT
39