fn update_page_state(&mut self) -> Result<()> {
        let ds = &self.default_state;
        let rs = &mut self.state;
        // Set these back to default values
        rs.text_rectangle = ds.text_rectangle;
        rs.line_spacing = ds.line_spacing;
        rs.line_number = 0;
        rs.span_number = 0;
        for value in self.parser.clone() {
            let val = value?;
            match val {
                Value::ColorBackground(clr) | Value::PageBackground(clr) => {
                    rs.color_ctx.set_background(clr, &val)?;
                }
                Value::NewPage() => break,
                Value::PageTime(on, off) => {
                    rs.page_on_time_ds = on.unwrap_or(ds.page_on_time_ds);
                    rs.page_off_time_ds = off.unwrap_or(ds.page_off_time_ds);
                }
                _ => (),
            }
        }
        Ok(())
    }
/// Iterate through page values to update its state.
Iterate through page values to update its state.
Iterate through page values to update its state .
fn update_page_state(&mut self) -> Result<()> {
        let ds = &self.default_state;
        let rs = &mut self.state;
        // Set these back to default values
        rs.text_rectangle = ds.text_rectangle;
        rs.line_spacing = ds.line_spacing;
        rs.line_number = 0;
        rs.span_number = 0;
        for value in self.parser.clone() {
            let val = value?;
            match val {
                Value::ColorBackground(clr) | Value::PageBackground(clr) => {
                    rs.color_ctx.set_background(clr, &val)?;
                }
                Value::NewPage() => break,
                Value::PageTime(on, off) => {
                    rs.page_on_time_ds = on.unwrap_or(ds.page_on_time_ds);
                    rs.page_off_time_ds = off.unwrap_or(ds.page_off_time_ds);
                }
                _ => (),
            }
        }
        Ok(())
    }
fn update_page_state ( & mut self ) -> Result < ( ) > { let ds = & self . default_state ; let rs = & mut self . state ; // Set these back to default values rs . text_rectangle = ds . text_rectangle ; rs . line_spacing = ds . line_spacing ; rs . line_number = 0 ; rs . span_number = 0 ; for value in self . parser . clone ( ) { let val = value ? ; match val { Value :: ColorBackground ( clr ) | Value :: PageBackground ( clr ) => { rs . color_ctx . set_background ( clr , & val ) ? ; } Value :: NewPage ( ) => break , Value :: PageTime ( on , off ) => { rs . page_on_time_ds = on . unwrap_or ( ds . page_on_time_ds ) ; rs . page_off_time_ds = off . unwrap_or ( ds . page_off_time_ds ) ; } _ => ( ) , } } Ok ( ( ) ) }
Iterate through page values to update its state.
Iterate through page values to update its state .
&mut self