base_traits/traits/is_default.rs
1// src/traits/is_default.rs : `IsDefault`
2
3/// Trait defining instance method `is_default() : bool` that allows a type
4/// instance to indicate whether it holds the "default" value.
5pub trait IsDefault {
6 fn is_default(&self) -> bool;
7}
8
9
10impl<T : IsDefault + ?Sized> IsDefault for Box<T> {
11 fn is_default(&self) -> bool {
12 (**self).is_default()
13 }
14}
15
16impl<T : IsDefault + ?Sized> IsDefault for std::rc::Rc<T> {
17 fn is_default(&self) -> bool {
18 (**self).is_default()
19 }
20}
21
22
23// ///////////////////////////// end of file //////////////////////////// //
24