mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-26 14:43:24 +00:00
Document the Zero trait
This commit is contained in:
parent
f107718a9b
commit
7c08abb0ce
@ -1717,7 +1717,8 @@ Supported traits for `deriving` are:
|
||||
* `Clone` and `DeepClone`, to perform (deep) copies.
|
||||
* `IterBytes`, to iterate over the bytes in a data type.
|
||||
* `Rand`, to create a random instance of a data type.
|
||||
* `Zero`, to create an zero (or empty) instance of a data type.
|
||||
* `Default`, to create an empty instance of a data type.
|
||||
* `Zero`, to create an zero instance of a numeric data type.
|
||||
* `ToStr`, to convert to a string. For a type with this instance,
|
||||
`obj.to_str()` has similar output as `fmt!("%?", obj)`, but it differs in that
|
||||
each constituent field of the type must also implement `ToStr` and will have
|
||||
|
@ -2249,7 +2249,7 @@ enum ABC { A, B, C }
|
||||
|
||||
The full list of derivable traits is `Eq`, `TotalEq`, `Ord`,
|
||||
`TotalOrd`, `Encodable` `Decodable`, `Clone`, `DeepClone`,
|
||||
`IterBytes`, `Rand`, `Zero`, and `ToStr`.
|
||||
`IterBytes`, `Rand`, `Default`, `Zero`, and `ToStr`.
|
||||
|
||||
# Crates and the module system
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user