diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/message.rs | 4 |
1 files changed, 4 insertions, 0 deletions
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<M: Message> { } impl<M: Message> Req<M> { + pub fn new(v: M) -> Result<Self, Error> { + Ok(v.into_req()?) + } + pub fn with_stream_from_buffer(self, b: Bytes) -> Self { Self { stream: AttachedStream::Fixed(b), |