WIP: send flow control
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use hpack;
|
||||
use error::{ConnectionError, Reason};
|
||||
|
||||
use bytes::Bytes;
|
||||
use bytes::{Bytes, Buf};
|
||||
|
||||
use std::fmt;
|
||||
|
||||
@@ -78,6 +78,18 @@ impl<T> Frame<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Buf> Frame<T> {
|
||||
/// Returns the length of the frame as it applies to flow control.
|
||||
pub fn flow_len(&self) -> usize {
|
||||
use self::Frame::*;
|
||||
|
||||
match *self {
|
||||
Data(ref frame) => frame.payload().remaining(),
|
||||
_ => 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> fmt::Debug for Frame<T> {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
use self::Frame::*;
|
||||
|
||||
Reference in New Issue
Block a user