Shuffle types around

This commit is contained in:
Carl Lerche
2017-06-27 11:04:36 -07:00
parent 1f85d54cff
commit 79aa11ad32
6 changed files with 91 additions and 56 deletions

View File

@@ -20,19 +20,23 @@ pub struct Settings<T> {
// True when the local settings must be flushed to the remote
is_dirty: bool,
// True when we have received a settings frame from the remote.
received_remote: bool,
}
impl<T> Settings<T>
where T: Stream<Item = Frame, Error = ConnectionError>,
T: Sink<SinkItem = Frame, SinkError = ConnectionError>,
{
pub fn new(inner: T, local: frame::SettingSet, remote: frame::SettingSet) -> Settings<T> {
pub fn new(inner: T, local: frame::SettingSet) -> Settings<T> {
Settings {
inner: inner,
local: local,
remote: remote,
remaining_acks: 1,
is_dirty: false,
remote: frame::SettingSet::default(),
remaining_acks: 0,
is_dirty: true,
received_remote: false,
}
}