Skip to content

Commit 4e0cb31

Browse files
committed
auto merge of #10840 : cmr/rust/any_docs2, r=huonw
2 parents a417dbd + 4051713 commit 4e0cb31

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/libstd/any.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@
99
// except according to those terms.
1010

1111
//! This module implements the `Any` trait, which enables dynamic typing
12-
//! of any type.
12+
//! of any type, through runtime reflection.
13+
//!
14+
//! `Any` itself can be used to get a `TypeId`, and has more features when used as a trait object.
15+
//! As `&Any` (a borrowed trait object), it has the `is` and `as_ref` methods, to test if the
16+
//! contained value is of a given type, and to get a reference to the inner value as a type. As
17+
//! `&mut Any`, there is also the `as_mut` method, for getting a mutable reference to the inner
18+
//! value. `~Any` adds the `move` method, which will unwrap a `~T` from the object. See the
19+
//! extension traits (`*Ext`) for the full details.
1320
1421
use cast::transmute;
1522
use option::{Option, Some, None};

0 commit comments

Comments
 (0)