traitful 0.3.0

A collection of helper macros for trait patterns
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::time::Duration;

use traitful::extend;

/// Extension trait for [`Duration`]
#[extend(Duration)]
pub trait DurationExt {
    /// Returns the total number of whole centiseconds contained by this
    /// [`Duration`].
    fn as_centis(&self) -> u128 {
        self.as_millis() / 10
    }
}