fn with_rollback<F, T>(&mut self, f: F) -> Result<T>
    where
        F: FnOnce(&mut Self) -> Result<T>,
    {
        let saved_section = self.section;
        let saved_cursor = self.cursor;
        let result = f(self);
        if result.is_err() {
            self.section = saved_section;
            self.cursor = saved_cursor;
        }
        result
    }
/// Executes `f(self)`, returning the result and rolling back the
/// section and cursor to the current values first if the result is
/// an error.
Executes `f(self)`, returning the result and rolling back the
section and cursor to the current values first if the result is
an error.
Executes ` f ( self ) ` returning the result and rolling back the section and cursor to the current values first if the result is an error .
fn with_rollback<F, T>(&mut self, f: F) -> Result<T>
    where
        F: FnOnce(&mut Self) -> Result<T>,
    {
        let saved_section = self.section;
        let saved_cursor = self.cursor;
        let result = f(self);
        if result.is_err() {
            self.section = saved_section;
            self.cursor = saved_cursor;
        }
        result
    }
fn with_rollback < F , T > ( & mut self , f : F ) -> Result < T > where F : FnOnce ( & mut Self ) -> Result < T > , { let saved_section = self . section ; let saved_cursor = self . cursor ; let result = f ( self ) ; if result . is_err ( ) { self . section = saved_section ; self . cursor = saved_cursor ; } result }
Executes `f(self)`, returning the result and rolling back the
section and cursor to the current values first if the result is
an error.
Executes ` f ( self ) ` returning the result and rolling back the section and cursor to the current values first if the result is an error .
&mut self
f
F
&mut self
f
F