From 56de24b29ac0f4b368bf85bd66444d5f80ad8c98 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Fri, 4 Nov 2022 15:18:36 +0800 Subject: [PATCH 1/4] add send_high_water_mark and set_send_high_water_mark to Framed --- src/framed.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/framed.rs b/src/framed.rs index 119437a..850c880 100644 --- a/src/framed.rs +++ b/src/framed.rs @@ -135,6 +135,20 @@ where pub fn read_buffer(&self) -> &BytesMut { self.inner.buffer() } + + /// High-water mark for writes, in bytes + /// + /// See [`FramedWrite::send_high_water_mark`]. + pub fn send_high_water_mark(&self) -> usize { + self.inner.high_water_mark + } + + /// Sets high-water mark for writes, in bytes + /// + /// See [`FramedWrite::set_send_high_water_mark`]. + pub fn set_send_high_water_mark(&mut self, hwm: usize) { + self.inner.high_water_mark = hwm; + } } impl Stream for Framed From 4ddfd4c5d76f561c46b8060b692d06cc88423623 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Sat, 5 Nov 2022 08:51:35 +0800 Subject: [PATCH 2/4] update changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d283bb..dab38f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Added + +- `Framed::send_high_water_mark` and `Framed::set_send_high_water_mark` [#3]. + +[#3]: https://github.com/mxinden/asynchronous-codec/pull/3 + ## [0.6.0] - 2021-02-01 ### Changed From 4f881893f6f928d572d519a36a74cdcc1677d15c Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Tue, 8 Nov 2022 10:45:28 +0800 Subject: [PATCH 3/4] bump version to 0.6.1 --- CHANGELOG.md | 2 ++ Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dab38f7..a5dfd4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ Versioning](https://semver.org/spec/v2.0.0.html). ## Unreleased +## [0.6.1] - 2022-11-08 + ### Added - `Framed::send_high_water_mark` and `Framed::set_send_high_water_mark` [#3]. diff --git a/Cargo.toml b/Cargo.toml index cc29d35..356f827 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "asynchronous-codec" edition = "2018" -version = "0.6.0" +version = "0.6.1" authors = ["Max Inden "] description = "Utilities for encoding and decoding frames using `async/await`" license = "MIT" From 3036f0a62f912317a9fd23b5032706e0997239e9 Mon Sep 17 00:00:00 2001 From: Max Inden Date: Tue, 8 Nov 2022 10:08:09 +0000 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5dfd4d..19ac856 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased - ## [0.6.1] - 2022-11-08 ### Added