From b04b6e3d2447a525cd5ff9efb71348605ca82915 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 7 Jun 2016 20:16:05 +0200 Subject: [PATCH] Add setters for DiaryId type --- libimagdiary/src/diaryid.rs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/libimagdiary/src/diaryid.rs b/libimagdiary/src/diaryid.rs index c2066506..3ca7db96 100644 --- a/libimagdiary/src/diaryid.rs +++ b/libimagdiary/src/diaryid.rs @@ -62,6 +62,36 @@ impl DiaryId { self.minute } + pub fn with_diary_name(mut self, name: String) -> DiaryId { + self.name = name; + self + } + + pub fn with_year(mut self, year: i32) -> DiaryId { + self.year = year; + self + } + + pub fn with_month(mut self, month: u32) -> DiaryId { + self.month = month; + self + } + + pub fn with_day(mut self, day: u32) -> DiaryId { + self.day = day; + self + } + + pub fn with_hour(mut self, hour: u32) -> DiaryId { + self.hour = hour; + self + } + + pub fn with_minute(mut self, minute: u32) -> DiaryId { + self.minute = minute; + self + } + } impl IntoStoreId for DiaryId {