pub struct CommonRestResult {
pub team_a_id: u32,
pub team_b_id: u32,
pub next_common_rest_date: Option<NaiveDate>,
pub days_until_next: Option<u32>,
pub common_rest_dates: Vec<NaiveDate>,
pub total_count: u32,
pub count_in_30_days: u32,
pub count_in_60_days: u32,
}Expand description
Result of a colleague-mode query.
use shift_algorithm::cycle::default_config;
use shift_statistics::colleague::find_common_rest_days;
use chrono::NaiveDate;
let config = default_config();
let today = NaiveDate::from_ymd_opt(2026, 5, 22).unwrap();
let result = find_common_rest_days(1, 3, today, 90, &config);
if let Some(date) = result.next_common_rest_date {
println!("下次共同休息: {}", date);
}
println!("未来30天: {} 次", result.count_in_30_days);Fields§
§team_a_id: u32First team ID (1-6).
team_b_id: u32Second team ID (1-6).
next_common_rest_date: Option<NaiveDate>The next date when both teams rest.
days_until_next: Option<u32>Days until the next common rest.
common_rest_dates: Vec<NaiveDate>All common rest dates within the analysis window.
total_count: u32Total common rest days found.
count_in_30_days: u32Common rests within the first 30 days.
count_in_60_days: u32Common rests within the first 60 days.
Trait Implementations§
Source§impl Clone for CommonRestResult
impl Clone for CommonRestResult
Source§fn clone(&self) -> CommonRestResult
fn clone(&self) -> CommonRestResult
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommonRestResult
impl Debug for CommonRestResult
Auto Trait Implementations§
impl Freeze for CommonRestResult
impl RefUnwindSafe for CommonRestResult
impl Send for CommonRestResult
impl Sync for CommonRestResult
impl Unpin for CommonRestResult
impl UnsafeUnpin for CommonRestResult
impl UnwindSafe for CommonRestResult
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