Skip to content

Commit

Permalink
Make the boxed constructor public for both futures (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
rklaehn committed Jun 25, 2024
2 parents 3b01e85 + 95dc615 commit 8144fde
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/transport/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ impl<'a, In: RpcMessage, Out: RpcMessage> OpenFuture<'a, In, Out> {
Self(OpenFutureInner::Direct(f))
}

fn boxed(
/// Create a new boxed future
pub fn boxed(
f: impl Future<Output = anyhow::Result<(SendSink<Out>, RecvStream<In>)>> + Send + Sync + 'a,
) -> Self {
Self(OpenFutureInner::Boxed(Box::pin(f)))
Expand Down Expand Up @@ -179,7 +180,8 @@ impl<'a, In: RpcMessage, Out: RpcMessage> AcceptFuture<'a, In, Out> {
Self(AcceptFutureInner::Direct(f))
}

fn boxed(
/// Create a new boxed future
pub fn boxed(
f: impl Future<Output = anyhow::Result<(SendSink<Out>, RecvStream<In>)>> + Send + Sync + 'a,
) -> Self {
Self(AcceptFutureInner::Boxed(Box::pin(f)))
Expand Down

0 comments on commit 8144fde

Please sign in to comment.