You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: time.rs
    path of file: ./repos/log4rs/src/append/rolling_file/policy/compound/trigger
    
    the code of the file until where you have to start completion: //! The time trigger.
//!
//! Requires the `time_trigger` feature.

#[cfg(test)]
use chrono::NaiveDateTime;
use chrono::{DateTime, Datelike, Duration, Local, TimeZone, Timelike};
#[cfg(test)]
use mock_instant::{SystemTime, UNIX_EPOCH};
use rand::Rng;
#[cfg(feature = "config_parsing")]
use serde::de;
#[cfg(feature = "config_parsing")]
use std::fmt;
use std::sync::RwLock;

use crate::append::rolling_file::{policy::compound::trigger::Trigger, LogFile};
#[cfg(feature = "config_parsing")]
use crate::config::{Deserialize, Deserializers};

#[cfg(feature = "config_parsing")]
/// Configuration for the time trigger.
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug, Default, serde::Deserialize)]
#[serde(deny_unknown_fields)]
pub struct TimeTriggerConfig {
    interval: TimeTriggerInterval,
    #[serde(default)]
    modulate: bool,
    #[serde(default)]
    max_random_delay: u64,
}

#[cfg(not(feature = "c
    
    pub fn new(config: TimeTriggerConfig) -> TimeTrigger {
        #[cfg(test)]
        let current = {
            let now: std::time::Duration = SystemTime::now()
                .duration_since(UNIX_EPOCH)
                .expect("system time before Unix epoch");
            NaiveDateTime::from_timestamp_opt(now.as_secs() as i64, now.subsec_nanos())
                .unwrap()
                .and_local_timezone(Local)
                .unwrap()
        };

        #[cfg(not(test))]
        let current = Local::now();
        let next_time = TimeTrigger::get_next_time(current, config.interval, config.modulate);
        let next_roll_time = if config.max_random_delay > 0 {
            let random_delay = rand::thread_rng().gen_range(0..config.max_random_delay);
            next_time + Duration::seconds(random_delay as i64)
        } else {
            next_time
        };

        TimeTrigger {
            config,
            next_roll_time: RwLock::new(next_roll_time),
        }
    }