base_traits/traits/
is_default.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// src/traits/is_default.rs : `IsDefault`

/// Trait defining instance method `is_default() : bool` that allows a type
/// instance to indicate whether it holds the "default" value.
pub trait IsDefault {
	fn is_default(&self) -> bool;
}


impl<T : IsDefault + ?Sized> IsDefault for Box<T> {
    fn is_default(&self) -> bool {
        (**self).is_default()
    }
}

impl<T : IsDefault + ?Sized> IsDefault for std::rc::Rc<T> {
    fn is_default(&self) -> bool {
        (**self).is_default()
    }
}


// ///////////////////////////// end of file //////////////////////////// //