]> git.lizzy.rs Git - rust.git/blob - src/libstd/ops.rs
Change finalize -> drop.
[rust.git] / src / libstd / ops.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 //! Traits for the built-in operators
12
13 #[allow(missing_doc)];
14
15 #[lang="drop"]
16 pub trait Drop {
17     fn drop(&self);
18 }
19
20 #[lang="add"]
21 pub trait Add<RHS,Result> {
22     fn add(&self, rhs: &RHS) -> Result;
23 }
24
25 #[lang="sub"]
26 pub trait Sub<RHS,Result> {
27     fn sub(&self, rhs: &RHS) -> Result;
28 }
29
30 #[lang="mul"]
31 pub trait Mul<RHS,Result> {
32     fn mul(&self, rhs: &RHS) -> Result;
33 }
34
35 #[lang="div"]
36 pub trait Div<RHS,Result> {
37     fn div(&self, rhs: &RHS) -> Result;
38 }
39
40 #[lang="rem"]
41 pub trait Rem<RHS,Result> {
42     fn rem(&self, rhs: &RHS) -> Result;
43 }
44
45 #[lang="neg"]
46 pub trait Neg<Result> {
47     fn neg(&self) -> Result;
48 }
49
50 #[lang="not"]
51 pub trait Not<Result> {
52     fn not(&self) -> Result;
53 }
54
55 #[lang="bitand"]
56 pub trait BitAnd<RHS,Result> {
57     fn bitand(&self, rhs: &RHS) -> Result;
58 }
59
60 #[lang="bitor"]
61 pub trait BitOr<RHS,Result> {
62     fn bitor(&self, rhs: &RHS) -> Result;
63 }
64
65 #[lang="bitxor"]
66 pub trait BitXor<RHS,Result> {
67     fn bitxor(&self, rhs: &RHS) -> Result;
68 }
69
70 #[lang="shl"]
71 pub trait Shl<RHS,Result> {
72     fn shl(&self, rhs: &RHS) -> Result;
73 }
74
75 #[lang="shr"]
76 pub trait Shr<RHS,Result> {
77     fn shr(&self, rhs: &RHS) -> Result;
78 }
79
80 #[lang="index"]
81 pub trait Index<Index,Result> {
82     fn index(&self, index: &Index) -> Result;
83 }