canic_core/ops/
service.rs1use crate::{
2 Error,
3 ops::{
4 OpsError,
5 model::memory::{
6 cycles::CycleTrackerOps, env::EnvOps, log::LogOps, reserve::CanisterReserveOps,
7 },
8 },
9};
10
11pub struct TimerService;
17
18impl TimerService {
19 pub fn start_all() -> Result<(), Error> {
21 EnvOps::try_get_subnet_type()?;
23
24 CycleTrackerOps::start();
25 LogOps::start_retention();
26
27 Ok(())
28 }
29
30 pub fn start_all_root() -> Result<(), Error> {
32 OpsError::require_root()?;
33
34 Self::start_all()?;
36
37 CanisterReserveOps::start();
39
40 Ok(())
41 }
42}