Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

util: add more get_{ref,mut,pin_mut} methods #3364

Merged
merged 2 commits into from
Jan 1, 2021

Conversation

tesaguri
Copy link
Contributor

@tesaguri tesaguri commented Dec 31, 2020

Motivation

Many wrapper types under tokio::io like BufReader have get_ref, get_mut and get_pin_mut methods and they seem to be good to have for tokio-util types as well.

Solution

This commit adds:

  • Framed::get_pin_mut
  • FramedRead::get_pin_mut
  • FramedWrite::get_pin_mut
  • StreamReader::get_ref
  • StreamReader::get_mut
  • StreamReader::get_pin_mut
  • StreamReader::into_inner

This commit adds:

- `Framed::get_pin_mut`
- `FramedRead::get_pin_mut`
- `FramedWrite::get_pin_mut`
- `StreamReader::get_ref`
- `StreamReader::get_mut`
- `StreamReader::get_pin_mut`
Copy link
Member

@taiki-e taiki-e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@taiki-e taiki-e added the A-tokio-util Area: The tokio-util crate label Dec 31, 2020
@@ -93,6 +93,29 @@ where
}
}

impl<S, B> StreamReader<S, B> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, StreamReader can probably provide into_inner.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

@Darksonn Darksonn merged commit 36918e0 into tokio-rs:master Jan 1, 2021
@tesaguri tesaguri deleted the more-get-inner branch January 1, 2021 13:31
tesaguri added a commit to tesaguri/tokio that referenced this pull request Jan 10, 2021
- codec: `get_ref()`, `get_mut()`, `get_pin_mut()` and `into_inner()` for
  `Framed`, `FramedRead`, `FramedWrite`, `StreamReader`, `StreamReader`,
  `StreamReader` and `StreamReader` (tokio-rs#3364).
- codec: `write_buffer()` and `write_buffer_mut()` for `Framed` and
  `FramedWrite` (tokio-rs#3387).
tesaguri added a commit to tesaguri/tokio that referenced this pull request Jan 10, 2021
- codec: `get_ref()`, `get_mut()`, `get_pin_mut()` and `into_inner()` for
  `Framed`, `FramedRead`, `FramedWrite`, `StreamReader`, `StreamReader`,
  `StreamReader` and `StreamReader` (tokio-rs#3364).
- codec: `write_buffer()` and `write_buffer_mut()` for `Framed` and
  `FramedWrite` (tokio-rs#3387).
tesaguri added a commit to tesaguri/tokio that referenced this pull request Jan 10, 2021
# 0.6.1 (January 10, 2020)

### Added

- codec: `get_ref()`, `get_mut()`, `get_pin_mut()` and `into_inner()` for
  `Framed`, `FramedRead`, `FramedWrite`, `StreamReader`, `StreamReader`,
  `StreamReader` and `StreamReader` (tokio-rs#3364).
- codec: `write_buffer()` and `write_buffer_mut()` for `Framed` and
  `FramedWrite` (tokio-rs#3387).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio-util Area: The tokio-util crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants