Add Req::new
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
Alex 2022-07-22 15:16:50 +02:00
parent cbc21e40ac
commit a0dac87e3b
Signed by: lx
GPG Key ID: 0E496D15096376BE
1 changed files with 4 additions and 0 deletions

View File

@ -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),