Skip to content

Commit 8144fde

Browse files
authored
Make the boxed constructor public for both futures (#85)
2 parents 3b01e85 + 95dc615 commit 8144fde

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/transport/boxed.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ impl<'a, In: RpcMessage, Out: RpcMessage> OpenFuture<'a, In, Out> {
142142
Self(OpenFutureInner::Direct(f))
143143
}
144144

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

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

0 commit comments

Comments
 (0)