pub fn new(data_dir: String) -> io::Result<PMMRBackend<T>> {
		let hs_file = AppendOnlyFile::open(format!("{}/{}", data_dir, PMMR_DATA_FILE))?;
		let sz = hs_file.size()?;
		let record_len = 32 + T::sum_len();
		let rm_log = RemoveLog::open(format!("{}/{}", data_dir, PMMR_RM_LOG_FILE))?;
		let prune_list = read_ordered_vec(format!("{}/{}", data_dir, PMMR_PRUNED_FILE), 8)?;

		Ok(PMMRBackend {
			data_dir: data_dir,
			hashsum_file: hs_file,
			remove_log: rm_log,
			buffer: VecBackend::new(),
			buffer_index: (sz as usize) / record_len,
			pruned_nodes: pmmr::PruneList {
				pruned_nodes: prune_list,
			},
			rewind: None,
		})
	}
/// Instantiates a new PMMR backend that will use the provided directly to
/// store its files.
Instantiates a new PMMR backend that will use the provided directly to
store its files.
Instantiates a new PMMR backend that will use the provided directly to store its files .
pub fn new(data_dir: String) -> io::Result<PMMRBackend<T>> {
		let hs_file = AppendOnlyFile::open(format!("{}/{}", data_dir, PMMR_DATA_FILE))?;
		let sz = hs_file.size()?;
		let record_len = 32 + T::sum_len();
		let rm_log = RemoveLog::open(format!("{}/{}", data_dir, PMMR_RM_LOG_FILE))?;
		let prune_list = read_ordered_vec(format!("{}/{}", data_dir, PMMR_PRUNED_FILE), 8)?;
		Ok(PMMRBackend {
			data_dir: data_dir,
			hashsum_file: hs_file,
			remove_log: rm_log,
			buffer: VecBackend::new(),
			buffer_index: (sz as usize) / record_len,
			pruned_nodes: pmmr::PruneList {
				pruned_nodes: prune_list,
			},
			rewind: None,
		})
	}
pub fn new ( data_dir : String ) -> io :: Result < PMMRBackend < T > > { let hs_file = AppendOnlyFile :: open ( format ! ( " " data_dir PMMR_DATA_FILE ) ) ? ; let sz = hs_file . size ( ) ? ; let record_len = 32 + T :: sum_len ( ) ; let rm_log = RemoveLog :: open ( format ! ( " " data_dir PMMR_RM_LOG_FILE ) ) ? ; let prune_list = read_ordered_vec ( format ! ( " " data_dir PMMR_PRUNED_FILE ) , 8 ) ? ; Ok ( PMMRBackend { data_dir : data_dir , hashsum_file : hs_file , remove_log : rm_log , buffer : VecBackend :: new ( ) , buffer_index : ( sz as usize ) / record_len , pruned_nodes : pmmr :: PruneList { pruned_nodes : prune_list , } , rewind : None , } ) }
Instantiates a new PMMR backend that will use the provided directly to
store its files.
Instantiates a new PMMR backend that will use the provided directly to store its files .
data_dir
String