| 1 | //! Code around a temperature graph widget. |
| 2 | |
| 3 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::timerust-analyzer cargo std https://github.com/rust-lang/rust/library/std time/::Instantrust-analyzer cargo std https://github.com/rust-lang/rust/library/std time/Instant#; |
| 4 | |
| 5 | use craterust-analyzer cargo bottom 0.14.9 crate/::componentsrust-analyzer cargo bottom 0.14.9 components/::time_seriesrust-analyzer cargo bottom 0.14.9 components/time_series/::{AutoYAxisTimeGraphrust-analyzer cargo bottom 0.14.9 components/time_series/auto_y/AutoYAxisTimeGraph#, TimeseriesConfigrust-analyzer cargo bottom 0.14.9 components/time_series/TimeseriesConfig#}; |
| 6 | |
| 7 | /// A time series graph widget displaying temperature usage over time. |
| 8 | pub struct TempGraphWidgetStaterust-analyzer cargo bottom 0.14.9 widgets/temperature_graph/TempGraphWidgetState# { |
| 9 | pub graphrust-analyzer cargo bottom 0.14.9 widgets/temperature_graph/TempGraphWidgetState#graph.: AutoYAxisTimeGraphrust-analyzer cargo bottom 0.14.9 components/time_series/auto_y/AutoYAxisTimeGraph#, |
| 10 | pub max_temprust-analyzer cargo bottom 0.14.9 widgets/temperature_graph/TempGraphWidgetState#max_temp.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<f32>, |
| 11 | } |
| 12 | |
| 13 | impl TempGraphWidgetStaterust-analyzer cargo bottom 0.14.9 widgets/temperature_graph/TempGraphWidgetState# { |
| 14 | pub fn newrust-analyzer cargo bottom 0.14.9 widgets/temperature_graph/impl#[TempGraphWidgetState]new().( |
| 15 | config: TimeseriesConfigrust-analyzer cargo bottom 0.14.9 components/time_series/TimeseriesConfig#, autohide_timer: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Instantrust-analyzer cargo std https://github.com/rust-lang/rust/library/std time/Instant#>, max_temp: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<f32>, |
| 16 | ) -> Selfrust-analyzer cargo bottom 0.14.9 widgets/temperature_graph/impl#[TempGraphWidgetState] { |
| 17 | TempGraphWidgetStaterust-analyzer cargo bottom 0.14.9 widgets/temperature_graph/TempGraphWidgetState# { |
| 18 | graphrust-analyzer cargo bottom 0.14.9 widgets/temperature_graph/TempGraphWidgetState#graph.: AutoYAxisTimeGraphrust-analyzer cargo bottom 0.14.9 components/time_series/auto_y/AutoYAxisTimeGraph#::newrust-analyzer cargo bottom 0.14.9 components/time_series/auto_y/impl#[AutoYAxisTimeGraph]new().(config, autohide_timer), |
| 19 | max_temprust-analyzer cargo bottom 0.14.9 widgets/temperature_graph/TempGraphWidgetState#max_temp., |
| 20 | } |
| 21 | } |
| 22 | } |