pub fn state(
        &mut self,
        timer: &Snapshot<'_>,
        layout_settings: &GeneralSettings,
    ) -> ComponentState {
        match self {
            Component::BlankSpace(component) => ComponentState::BlankSpace(component.state()),
            Component::CurrentComparison(component) => {
                ComponentState::KeyValue(component.state(timer))
            }
            Component::CurrentPace(component) => ComponentState::KeyValue(component.state(timer)),
            Component::Delta(component) => {
                ComponentState::KeyValue(component.state(timer, layout_settings))
            }
            Component::DetailedTimer(component) => {
                ComponentState::DetailedTimer(Box::new(component.state(timer, layout_settings)))
            }
            Component::Graph(component) => {
                ComponentState::Graph(component.state(timer, layout_settings))
            }
            Component::PbChance(component) => ComponentState::KeyValue(component.state(timer)),
            Component::PossibleTimeSave(component) => {
                ComponentState::KeyValue(component.state(timer))
            }
            Component::PreviousSegment(component) => {
                ComponentState::KeyValue(component.state(timer, layout_settings))
            }
            Component::SegmentTime(component) => ComponentState::KeyValue(component.state(timer)),
            Component::Separator(component) => ComponentState::Separator(component.state()),
            Component::Splits(component) => {
                ComponentState::Splits(component.state(timer, layout_settings))
            }
            Component::SumOfBest(component) => ComponentState::KeyValue(component.state(timer)),
            Component::Text(component) => ComponentState::Text(component.state(timer)),
            Component::Timer(component) => {
                ComponentState::Timer(component.state(timer, layout_settings))
            }
            Component::Title(component) => ComponentState::Title(component.state(timer)),
            Component::TotalPlaytime(component) => ComponentState::KeyValue(component.state(timer)),
        }
    }
/// Calculates the component's state based on the timer and settings
/// provided. The timer provides the information to visualize and the layout
/// settings provide general information about how to expose that
/// information in the state.
Calculates the component's state based on the timer and settings
provided. The timer provides the information to visualize and the layout
settings provide general information about how to expose that
information in the state.
Calculates the component ' s state based on the timer and settings provided . The timer provides the information to visualize and the layout settings provide general information about how to expose that information in the state .
pub fn state(
        &mut self,
        timer: &Snapshot<'_>,
        layout_settings: &GeneralSettings,
    ) -> ComponentState {
        match self {
            Component::BlankSpace(component) => ComponentState::BlankSpace(component.state()),
            Component::CurrentComparison(component) => {
                ComponentState::KeyValue(component.state(timer))
            }
            Component::CurrentPace(component) => ComponentState::KeyValue(component.state(timer)),
            Component::Delta(component) => {
                ComponentState::KeyValue(component.state(timer, layout_settings))
            }
            Component::DetailedTimer(component) => {
                ComponentState::DetailedTimer(Box::new(component.state(timer, layout_settings)))
            }
            Component::Graph(component) => {
                ComponentState::Graph(component.state(timer, layout_settings))
            }
            Component::PbChance(component) => ComponentState::KeyValue(component.state(timer)),
            Component::PossibleTimeSave(component) => {
                ComponentState::KeyValue(component.state(timer))
            }
            Component::PreviousSegment(component) => {
                ComponentState::KeyValue(component.state(timer, layout_settings))
            }
            Component::SegmentTime(component) => ComponentState::KeyValue(component.state(timer)),
            Component::Separator(component) => ComponentState::Separator(component.state()),
            Component::Splits(component) => {
                ComponentState::Splits(component.state(timer, layout_settings))
            }
            Component::SumOfBest(component) => ComponentState::KeyValue(component.state(timer)),
            Component::Text(component) => ComponentState::Text(component.state(timer)),
            Component::Timer(component) => {
                ComponentState::Timer(component.state(timer, layout_settings))
            }
            Component::Title(component) => ComponentState::Title(component.state(timer)),
            Component::TotalPlaytime(component) => ComponentState::KeyValue(component.state(timer)),
        }
    }
pub fn state ( & mut self , timer : & Snapshot < ' _ > , layout_settings : & GeneralSettings , ) -> ComponentState { match self { Component :: BlankSpace ( component ) => ComponentState :: BlankSpace ( component . state ( ) ) , Component :: CurrentComparison ( component ) => { ComponentState :: KeyValue ( component . state ( timer ) ) } Component :: CurrentPace ( component ) => ComponentState :: KeyValue ( component . state ( timer ) ) , Component :: Delta ( component ) => { ComponentState :: KeyValue ( component . state ( timer , layout_settings ) ) } Component :: DetailedTimer ( component ) => { ComponentState :: DetailedTimer ( Box :: new ( component . state ( timer , layout_settings ) ) ) } Component :: Graph ( component ) => { ComponentState :: Graph ( component . state ( timer , layout_settings ) ) } Component :: PbChance ( component ) => ComponentState :: KeyValue ( component . state ( timer ) ) , Component :: PossibleTimeSave ( component ) => { ComponentState :: KeyValue ( component . state ( timer ) ) } Component :: PreviousSegment ( component ) => { ComponentState :: KeyValue ( component . state ( timer , layout_settings ) ) } Component :: SegmentTime ( component ) => ComponentState :: KeyValue ( component . state ( timer ) ) , Component :: Separator ( component ) => ComponentState :: Separator ( component . state ( ) ) , Component :: Splits ( component ) => { ComponentState :: Splits ( component . state ( timer , layout_settings ) ) } Component :: SumOfBest ( component ) => ComponentState :: KeyValue ( component . state ( timer ) ) , Component :: Text ( component ) => ComponentState :: Text ( component . state ( timer ) ) , Component :: Timer ( component ) => { ComponentState :: Timer ( component . state ( timer , layout_settings ) ) } Component :: Title ( component ) => ComponentState :: Title ( component . state ( timer ) ) , Component :: TotalPlaytime ( component ) => ComponentState :: KeyValue ( component . state ( timer ) ) , } }
Calculates the component's state based on the timer and settings
provided.
Calculates the component ' s state based on the timer and settings provided .
&mut self
timer
&Snapshot<'_>
layout_settings
&GeneralSettings
&mut self
timer
&Snapshot<'_>
layout_settings
&GeneralSettings