An optional value.
enum Option<T> {
None,
Some(T),
}| Name | Description |
|---|---|
| None | The value is not present. |
| Some | The value is present. |
| Receiver | Name | Description |
|---|---|---|
&mut self | as_mut | Returns an |
&self | as_ref | Returns an |
self | chain | Applies a function to the value (if any) and returns the result. |
&self | is_none | Returns whether this object does not contain a value. |
&self | is_some | Returns whether this object contains a value. |
self | map | If the value is present, replaces it by the result of a function application. |
&mut self | take | Replaces the value by |
self | unwrap | Unwraps the value or aborts. |
self | unwrap_or | Unwraps the value or returns another one. |
| Name | Description |
|---|---|
| Clone | Objects that can be duplicated. |
| Copy | Objects that can safely be copied via |
| Eq | Objects that implement the binary |
| Hash | Objects that can be hashed. |
| Iterator | Objects that can be iterated over. |
| MaybeClone | Objects that can be duplicated. |