Add test and assertion for idle state handling (#160)

This commit is contained in:
Eliza Weisman
2017-10-27 14:14:00 -07:00
committed by Carl Lerche
parent b1d282799b
commit 8a1c4d3d52
4 changed files with 158 additions and 2 deletions

View File

@@ -331,6 +331,13 @@ impl State {
}
}
pub fn is_idle(&self) -> bool {
match self.inner {
Idle => true,
_ => false,
}
}
pub fn ensure_recv_open(&self) -> Result<bool, proto::Error> {
use std::io;