Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
seunlanlege committed Sep 4, 2019
1 parent f2ad056 commit 832b176
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ethcore/client-traits/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,12 @@ impl FromStr for DataFormat {
}
}

/// Provides a method for exporting blocks
pub trait ExportBlocks {
/// Export blocks to destination, with the given from, to and format arguments.
/// destination could be a file or stdout.
/// if the format is hex, each block is written on a new line.
/// for binary exports, all block data is written to the same line.
fn export_blocks<'a>(
&self,
destination: Box<dyn std::io::Write + 'a>,
Expand All @@ -545,7 +550,13 @@ pub trait ExportBlocks {
) -> Result<(), String>;
}

/// Provides a method for importing blocks
pub trait ImportBlocks {
/// Import blocks from destination, with the given format arguments
/// source could be a file or stdout.
/// For hex imports, it attempts to read the blocks on a line by line basis.
/// For binary imports, it'll read the 8 byte rlp header in order to decode the block
/// length to be read.
fn import_blocks<'a>(
&self,
source: Box<dyn std::io::Read + 'a>,
Expand Down

0 comments on commit 832b176

Please sign in to comment.