More tweaks

This commit is contained in:
Carl Lerche
2017-08-08 14:26:38 -07:00
parent 8485bf91e7
commit 8a5e0c3046
2 changed files with 53 additions and 44 deletions

View File

@@ -243,6 +243,17 @@ impl State {
}
}
/// Returns true if a stream with the current state counts against the
/// concurrency limit.
pub fn is_counted(&self) -> bool {
match self.inner {
Open { .. } => true,
HalfClosedLocal(..) => true,
HalfClosedRemote(..) => true,
_ => false,
}
}
pub fn is_closed(&self) -> bool {
match self.inner {
Closed(_) => true,