/// Creates a checkpoint from the "tip" state returning layout object of
/// the newly created checkpoint
Creates a checkpoint from the "tip" state returning layout object of
the newly created checkpoint
Creates a checkpoint from the " tip " state returning layout object of the newly created checkpoint
pub fn tip_to_checkpoint(
        &self,
        tip: CheckpointLayout<RwPolicy>,
        height: Height,
        thread_pool: Option<&mut scoped_threadpool::Pool>,
    ) -> Result<CheckpointLayout<ReadOnly>, LayoutError> {
        let cp_name = self.checkpoint_name(height);
        match self
            .cp_manager
            .tip_to_checkpoint(tip.raw_path(), &cp_name, thread_pool)
        {
            Ok(new_cp) => CheckpointLayout::new(new_cp, height),
            Err(err) if is_dir_already_exists_err(&err) => Err(LayoutError::AlreadyExists(height)),
            Err(err) => Err(LayoutError::IoError {
                path: tip.raw_path().to_path_buf(),
                message: format!(
                    "Failed to convert tip to checkpoint to {} (err kind: {:?})",
                    cp_name,
                    err.kind()
                ),
                io_err: err,
            }),
        }
    }
pub fn tip_to_checkpoint ( & self , tip : CheckpointLayout < RwPolicy > , height : Height , thread_pool : Option < & mut scoped_threadpool :: Pool > , ) -> Result < CheckpointLayout < ReadOnly > , LayoutError > { let cp_name = self . checkpoint_name ( height ) ; match self . cp_manager . tip_to_checkpoint ( tip . raw_path ( ) , & cp_name , thread_pool ) { Ok ( new_cp ) => CheckpointLayout :: new ( new_cp , height ) , Err ( err ) if is_dir_already_exists_err ( & err ) => Err ( LayoutError :: AlreadyExists ( height ) ) , Err ( err ) => Err ( LayoutError :: IoError { path : tip . raw_path ( ) . to_path_buf ( ) , message : format ! ( " " cp_name err kind ( ) ) , io_err : err , } ) , } }
Creates a checkpoint from the "tip" state returning layout object of
the newly created checkpoint
Creates a checkpoint from the " tip " state returning layout object of the newly created checkpoint
&self
tip
CheckpointLayout<RwPolicy>
height
Height
thread_pool
Option<&mut scoped_threadpool::Pool>