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

ClientStream.split exposes private types #195

Closed
powturns opened this issue Jun 21, 2023 · 0 comments · Fixed by #196
Closed

ClientStream.split exposes private types #195

powturns opened this issue Jun 21, 2023 · 0 comments · Fixed by #196

Comments

@powturns
Copy link
Contributor

Description of problem

The current implementation:

ClientStream {
    pub fn split(self) -> (CSSender<Q>, CSReceiver<P>) {
        (self.tx, self.rx)
    }
}

returns CSSender and CSReceiver, which are not public / re-exported in the asynchronous module. This is fine if the sender/receiver are only used locally, but prevents them from being passed to a function / stored in a struct.

Expected result

The types returned by split can be passed to functions / structs.

Actual result

Compile error:

20 | use ttrpc::asynchronous::stream::{CSSender, CSReceiver};
   |                          ^^^^^^ private module
   |

or

21 | use ttrpc::asynchronous::{CSSender, CSReceiver};
   |                           ^^^^^^^^  ^^^^^^^^^^ no `CSReceiver` in `asynchronous`
   |                           |
   |                           no `CSSender` in `asynchronous`
wllenyj added a commit to wllenyj/ttrpc-rust that referenced this issue Jun 22, 2023
wllenyj added a commit to wllenyj/ttrpc-rust that referenced this issue Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant