From a0dac87e3b8b749afa63b5707eefeb676e23b622 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Fri, 22 Jul 2022 15:16:50 +0200 Subject: [PATCH] Add Req::new --- src/message.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/message.rs b/src/message.rs index ff9861c..7cf1918 100644 --- a/src/message.rs +++ b/src/message.rs @@ -60,6 +60,10 @@ pub struct Req { } impl Req { + pub fn new(v: M) -> Result { + Ok(v.into_req()?) + } + pub fn with_stream_from_buffer(self, b: Bytes) -> Self { Self { stream: AttachedStream::Fixed(b),