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: frame_sync.rs
    path of file: ./repos/carbonyl/src/output
    
    the code of the file until where you have to start completion: use std::time::{Duration, Instant};

/// A utility to synchronize rendering with a given FPS
pub struct FrameSync {
    render_start: Option<Instant>,
    frame
    
    pub fn deadline(&self) -> Instant {
        match self.render_start {
            // We never rendered yet, render now!
            None => Instant::now(),
            // Else we should render `frame_duration` after the last render start.
            // If we render at 60 FPS, this should be 16ms after the render start.
            // If the render takes more than the frame duration, this will always
            // return a deadline in a the past, making render happen immediately.
            Some(render_start) => render_start + self.frame_duration,
        }
    }