pub struct LeaveStrategy {
pub leave_days: u32,
pub total_break_days: u32,
pub leave_dates: Vec<NaiveDate>,
pub break_start: NaiveDate,
pub break_end: NaiveDate,
pub holiday_overlap: u32,
pub weekend_overlap: u32,
pub overlapping_holiday_names: Vec<String>,
pub efficiency: f64,
pub score: f64,
}Expand description
A single leave strategy.
Returned by find_best_leave_plans, sorted by score descending.
Fields§
§leave_days: u32Number of leave days needed.
total_break_days: u32Total consecutive break days achieved (rest + weekend + holiday + leave).
leave_dates: Vec<NaiveDate>The specific dates to request leave.
break_start: NaiveDateFirst day of the continuous break.
break_end: NaiveDateLast day of the continuous break.
holiday_overlap: u32Number of statutory holiday days within the break.
weekend_overlap: u32Number of weekend days within the break.
overlapping_holiday_names: Vec<String>Names of overlapping holidays (e.g. “国庆节”, “春节”).
efficiency: f64Efficiency ratio = total_break_days / leave_days (higher is better).
score: f64Composite score 0..1 (50% efficiency + 25% length + 25% family).
Trait Implementations§
Source§impl Clone for LeaveStrategy
impl Clone for LeaveStrategy
Source§fn clone(&self) -> LeaveStrategy
fn clone(&self) -> LeaveStrategy
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 LeaveStrategy
impl Debug for LeaveStrategy
Auto Trait Implementations§
impl Freeze for LeaveStrategy
impl RefUnwindSafe for LeaveStrategy
impl Send for LeaveStrategy
impl Sync for LeaveStrategy
impl Unpin for LeaveStrategy
impl UnsafeUnpin for LeaveStrategy
impl UnwindSafe for LeaveStrategy
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