Skip to content

Commit 4051713

Browse files
committed
Add some Any docs.
1 parent aa4455e commit 4051713

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/libstd/any.rs

+8-1
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)