Skip to content

Commit

Permalink
doc tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
pmarks committed Jul 14, 2019
1 parent 2f7bf36 commit aa92f23
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "shardio"
version = "0.5.3"
version = "0.5.4"
authors = ["Patrick Marks <[email protected]>", "Sreenath Krishnan <[email protected]>", "Lance Hepler <[email protected]>"]
edition = "2018"
license = "MIT"
Expand Down
9 changes: 7 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
//! sender.send(DataStruct { a: (i%25) as u64, b: (i%100) as u32 });
//! }
//!
//! // done sending items
//! sender.finished();
//!
//! // Write errors are accessible by calling the finish() method
//! writer.finish()?;
//! }
Expand Down Expand Up @@ -302,7 +305,8 @@ where
/// flush remaining items to disk, write an index of the chunk data and close the file.
///
/// The `get_sender()` methods returns a `ShardSender` that must be used to send items to the writer.
/// You must close each ShardSender by calling its `finish()` method, or data may be lost.
/// You must close each ShardSender by dropping it or calling its `finish()` method, or data may be lost.
/// The `ShardSender` must be dropped/finished prior to callinng `SharWriter::finish` or dropping the shard writer.
///
/// # Sorting
/// Items are sorted according to the `Ord` implementation of type `S::Key`. Type `S`, implementing the `SortKey` trait
Expand Down Expand Up @@ -692,7 +696,8 @@ impl<T: Send> ShardSender<T> {
}

/// Signal that you've finished sending items to this `ShardSender`. `finished` will called
/// if the `ShardSender` is dropped.
/// if the `ShardSender` is dropped. You must call `finished()` or drop the `ShardSender`
/// prior to calling `ShardWriter::finish` or dropping the ShardWriter, or you will get a panic.
pub fn finished(&mut self) {
if !self.buffer.is_empty() {
let mut send_buf = Vec::new();
Expand Down

0 comments on commit aa92f23

Please sign in to comment.