]> git.lizzy.rs Git - rust.git/blob - src/libstd/kinds.rs
auto merge of #10977 : brson/rust/androidtest, r=brson
[rust.git] / src / libstd / kinds.rs
1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 /*!
12 The kind traits
13
14 Rust types can be classified in various useful ways according to
15 intrinsic properties of the type. These classifications, often called
16 'kinds', are represented as traits.
17
18 They cannot be implemented by user code, but are instead implemented
19 by the compiler automatically for the types to which they apply.
20
21 */
22
23 /// Types able to be transferred across task boundaries.
24 #[lang="send"]
25 pub trait Send {
26     // empty.
27 }
28
29 /// Types that are either immutable or have inherited mutability.
30 #[lang="freeze"]
31 pub trait Freeze {
32     // empty.
33 }
34
35 /// Types with a constant size known at compile-time.
36 #[lang="sized"]
37 pub trait Sized {
38     // Empty.
39 }
40
41 /// Types that can be copied by simply copying bits (i.e. `memcpy`).
42 ///
43 /// The name "POD" stands for "Plain Old Data" and is borrowed from C++.
44 #[cfg(not(stage0))]
45 #[lang="pod"]
46 pub trait Pod {
47     // Empty.
48 }
49