Trait try_default::TryDefault [−][src]
A trait for all types!
If the type has a Default
value,
use ::try_default::TryDefault; // Set to `Some(0)`. let default_num = <u32>::try_default(); // Set to `None`, as `::std::fs::File` has no `Default`. let default_file = <::std::fs::File>::try_default();
Required methods
fn try_default() -> Option<V>
[src]
If the implementor implements Default, then this will return
Option::Some(Default::default())
.
Otherwise it returns Option::None
.