Skip to content

Commit 45e54df

Browse files
committed
make it so upgrade connections can be built from the outside
1 parent 908aaa2 commit 45e54df

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/upgrade/connection.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ pub struct RawConnection<Inner> {
99
inner: Inner,
1010
}
1111

12+
impl Connection {
13+
pub fn new<T: InnerConnection + 'static>(t: T) -> Self {
14+
RawConnection { inner: Box::new(t) }
15+
}
16+
}
17+
1218
/// A boxed upgraded HTTP connection.
1319
pub type Connection = RawConnection<Box<dyn InnerConnection + 'static>>;
1420

0 commit comments

Comments
 (0)