pub fn update_state(
        &mut self,
        state: &mut ComponentState,
        timer: &Snapshot<'_>,
        layout_settings: &GeneralSettings,
    ) {
        match (state, self) {
            (ComponentState::BlankSpace(state), Component::BlankSpace(component)) => {
                component.update_state(state)
            }
            (ComponentState::KeyValue(state), Component::CurrentComparison(component)) => {
                component.update_state(state, timer)
            }
            (ComponentState::KeyValue(state), Component::CurrentPace(component)) => {
                component.update_state(state, timer)
            }
            (ComponentState::KeyValue(state), Component::Delta(component)) => {
                component.update_state(state, timer, layout_settings)
            }
            (ComponentState::DetailedTimer(state), Component::DetailedTimer(component)) => {
                component.update_state(&mut *state, timer, layout_settings)
            }
            (ComponentState::Graph(state), Component::Graph(component)) => {
                component.update_state(state, timer, layout_settings)
            }
            (ComponentState::KeyValue(state), Component::PbChance(component)) => {
                component.update_state(state, timer)
            }
            (ComponentState::KeyValue(state), Component::PossibleTimeSave(component)) => {
                component.update_state(state, timer)
            }
            (ComponentState::KeyValue(state), Component::PreviousSegment(component)) => {
                component.update_state(state, timer, layout_settings)
            }
            (ComponentState::KeyValue(state), Component::SegmentTime(component)) => {
                component.update_state(state, timer)
            }
            (ComponentState::Separator(state), Component::Separator(component)) => {
                component.update_state(state)
            }
            (ComponentState::Splits(state), Component::Splits(component)) => {
                component.update_state(state, timer, layout_settings)
            }
            (ComponentState::KeyValue(state), Component::SumOfBest(component)) => {
                component.update_state(state, timer)
            }
            (ComponentState::Text(state), Component::Text(component)) => {
                component.update_state(state, timer)
            }
            (ComponentState::Timer(state), Component::Timer(component)) => {
                component.update_state(state, timer, layout_settings)
            }
            (ComponentState::Title(state), Component::Title(component)) => {
                component.update_state(state, timer)
            }
            (ComponentState::KeyValue(state), Component::TotalPlaytime(component)) => {
                component.update_state(state, timer)
            }
            (state, component) => *state = component.state(timer, layout_settings),
        }
    }
/// Updates 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.
Updates 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.
Updates 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 update_state(
        &mut self,
        state: &mut ComponentState,
        timer: &Snapshot<'_>,
        layout_settings: &GeneralSettings,
    ) {
        match (state, self) {
            (ComponentState::BlankSpace(state), Component::BlankSpace(component)) => {
                component.update_state(state)
            }
            (ComponentState::KeyValue(state), Component::CurrentComparison(component)) => {
                component.update_state(state, timer)
            }
            (ComponentState::KeyValue(state), Component::CurrentPace(component)) => {
                component.update_state(state, timer)
            }
            (ComponentState::KeyValue(state), Component::Delta(component)) => {
                component.update_state(state, timer, layout_settings)
            }
            (ComponentState::DetailedTimer(state), Component::DetailedTimer(component)) => {
                component.update_state(&mut *state, timer, layout_settings)
            }
            (ComponentState::Graph(state), Component::Graph(component)) => {
                component.update_state(state, timer, layout_settings)
            }
            (ComponentState::KeyValue(state), Component::PbChance(component)) => {
                component.update_state(state, timer)
            }
            (ComponentState::KeyValue(state), Component::PossibleTimeSave(component)) => {
                component.update_state(state, timer)
            }
            (ComponentState::KeyValue(state), Component::PreviousSegment(component)) => {
                component.update_state(state, timer, layout_settings)
            }
            (ComponentState::KeyValue(state), Component::SegmentTime(component)) => {
                component.update_state(state, timer)
            }
            (ComponentState::Separator(state), Component::Separator(component)) => {
                component.update_state(state)
            }
            (ComponentState::Splits(state), Component::Splits(component)) => {
                component.update_state(state, timer, layout_settings)
            }
            (ComponentState::KeyValue(state), Component::SumOfBest(component)) => {
                component.update_state(state, timer)
            }
            (ComponentState::Text(state), Component::Text(component)) => {
                component.update_state(state, timer)
            }
            (ComponentState::Timer(state), Component::Timer(component)) => {
                component.update_state(state, timer, layout_settings)
            }
            (ComponentState::Title(state), Component::Title(component)) => {
                component.update_state(state, timer)
            }
            (ComponentState::KeyValue(state), Component::TotalPlaytime(component)) => {
                component.update_state(state, timer)
            }
            (state, component) => *state = component.state(timer, layout_settings),
        }
    }
pub fn update_state ( & mut self , state : & mut ComponentState , timer : & Snapshot < ' _ > , layout_settings : & GeneralSettings , ) { match ( state , self ) { ( ComponentState :: BlankSpace ( state ) , Component :: BlankSpace ( component ) ) => { component . update_state ( state ) } ( ComponentState :: KeyValue ( state ) , Component :: CurrentComparison ( component ) ) => { component . update_state ( state , timer ) } ( ComponentState :: KeyValue ( state ) , Component :: CurrentPace ( component ) ) => { component . update_state ( state , timer ) } ( ComponentState :: KeyValue ( state ) , Component :: Delta ( component ) ) => { component . update_state ( state , timer , layout_settings ) } ( ComponentState :: DetailedTimer ( state ) , Component :: DetailedTimer ( component ) ) => { component . update_state ( & mut * state , timer , layout_settings ) } ( ComponentState :: Graph ( state ) , Component :: Graph ( component ) ) => { component . update_state ( state , timer , layout_settings ) } ( ComponentState :: KeyValue ( state ) , Component :: PbChance ( component ) ) => { component . update_state ( state , timer ) } ( ComponentState :: KeyValue ( state ) , Component :: PossibleTimeSave ( component ) ) => { component . update_state ( state , timer ) } ( ComponentState :: KeyValue ( state ) , Component :: PreviousSegment ( component ) ) => { component . update_state ( state , timer , layout_settings ) } ( ComponentState :: KeyValue ( state ) , Component :: SegmentTime ( component ) ) => { component . update_state ( state , timer ) } ( ComponentState :: Separator ( state ) , Component :: Separator ( component ) ) => { component . update_state ( state ) } ( ComponentState :: Splits ( state ) , Component :: Splits ( component ) ) => { component . update_state ( state , timer , layout_settings ) } ( ComponentState :: KeyValue ( state ) , Component :: SumOfBest ( component ) ) => { component . update_state ( state , timer ) } ( ComponentState :: Text ( state ) , Component :: Text ( component ) ) => { component . update_state ( state , timer ) } ( ComponentState :: Timer ( state ) , Component :: Timer ( component ) ) => { component . update_state ( state , timer , layout_settings ) } ( ComponentState :: Title ( state ) , Component :: Title ( component ) ) => { component . update_state ( state , timer ) } ( ComponentState :: KeyValue ( state ) , Component :: TotalPlaytime ( component ) ) => { component . update_state ( state , timer ) } ( state , component ) => * state = component . state ( timer , layout_settings ) , } }
Updates the component's state based on the timer and settings provided.
Updates the component ' s state based on the timer and settings provided .
&mut self
state
&mut ComponentState
timer
&Snapshot<'_>
layout_settings
&GeneralSettings
&mut self
state
&mut ComponentState
timer
&Snapshot<'_>
layout_settings
&GeneralSettings