Skip to content

Commit

Permalink
Merge pull request #3 from melekes/anton/set-watermark
Browse files Browse the repository at this point in the history
framed/: Add `send_high_water_mark` and `set_send_high_water_mark`
  • Loading branch information
mxinden authored Nov 8, 2022
2 parents bbfc285 + 3036f0a commit 43338f6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

## [0.6.1] - 2022-11-08

### 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
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "asynchronous-codec"
edition = "2018"
version = "0.6.0"
version = "0.6.1"
authors = ["Max Inden <[email protected]>"]
description = "Utilities for encoding and decoding frames using `async/await`"
license = "MIT"
Expand Down
14 changes: 14 additions & 0 deletions src/framed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T, U> Stream for Framed<T, U>
Expand Down

0 comments on commit 43338f6

Please sign in to comment.