Struct swh_graph_contributions::YearSet
source · pub struct YearSet(/* private fields */);
Expand description
Compact representation of a set of years
Only the current year and the last 63 are supported, others are ignored
let mut set = YearSet::default();
set.insert_timestamp_year(1713967146); // 2024-04-24
set.insert_timestamp_year(1666019057); // 2022-10-17
set.insert_timestamp_year(-1713967146); // 1915-09-09
assert_eq!(set.iter().collect::<HashSet<_>>(), vec![2022, 2024].into_iter().collect());
Implementations§
Trait Implementations§
source§impl PartialEq for YearSet
impl PartialEq for YearSet
impl Eq for YearSet
impl StructuralEq for YearSet
impl StructuralPartialEq for YearSet
Auto Trait Implementations§
impl RefUnwindSafe for YearSet
impl Send for YearSet
impl Sync for YearSet
impl Unpin for YearSet
impl UnwindSafe for YearSet
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more