Skip to main content

ShortIntervalsInfo

Struct ShortIntervalsInfo 

Source
pub struct ShortIntervalsInfo {
    pub count: usize,
    pub total_duration: Duration,
    pub intervals: Vec<(usize, WorkInterval)>,
    pub pauses_to_remove: Vec<usize>,
}
Expand description

Information about short intervals detected in a workday.

This structure provides comprehensive analysis of work intervals that fall below the minimum duration threshold. It includes both statistical information about the impact of short intervals and actionable recommendations for optimization.

§Analysis Components

§Statistical Information

  • Count: Number of short intervals detected
  • Total Duration: Cumulative time spent in short work periods
  • Individual Intervals: Specific intervals with their details

§Optimization Recommendations

  • Pauses to Remove: Specific pauses that could be eliminated
  • Merge Opportunities: Intervals that could be combined
  • Productivity Impact: Potential time savings from optimization

§Usage Context

This analysis is used for:

  • Generating optimization recommendations in reports
  • Identifying patterns of work fragmentation
  • Calculating potential productivity improvements
  • Providing actionable feedback to users

Fields§

§count: usize

The number of intervals that fall below the minimum duration threshold.

This count provides a quick assessment of work fragmentation:

  • 0: No fragmentation issues detected
  • 1-3: Minor fragmentation, limited impact
  • 4+: Significant fragmentation, optimization recommended
§total_duration: Duration

The cumulative duration of all short intervals combined.

Represents the total amount of time spent in fragmented work periods. This metric helps quantify the impact of work interruptions and provides context for optimization efforts.

§Impact Assessment

  • < 30 minutes: Minor impact on overall productivity
  • 30-60 minutes: Moderate impact, optimization beneficial
  • > 60 minutes: Significant impact, optimization essential
§intervals: Vec<(usize, WorkInterval)>

Detailed information about each short interval detected.

Each tuple contains:

  • Index: Position of the interval in the original collection
  • WorkInterval: Complete interval data with timing information

This detailed information enables:

  • Specific analysis of each fragmented period
  • Identification of patterns in interruption timing
  • Targeted recommendations for specific intervals
§pauses_to_remove: Vec<usize>

Indices of pauses that could be removed to merge short intervals.

These pause indices represent optimization opportunities where removing or consolidating breaks could create longer, more productive work intervals. The indices correspond to positions in the original pause collection.

§Optimization Strategy

  • Pause Removal: Eliminate unnecessary short breaks
  • Pause Consolidation: Combine multiple short breaks into fewer, longer ones
  • Timing Adjustment: Shift break timing to create better work blocks

§Implementation Notes

To remove a short interval, remove the pause that created it by separating it from the previous interval. This effectively merges the short interval with its predecessor.

Trait Implementations§

Source§

impl Debug for ShortIntervalsInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more