Skip to content

ClientStream.split exposes private types #195

@powturns

Description

@powturns

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`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions