Add Req::new
This commit is contained in:
parent
cbc21e40ac
commit
a0dac87e3b
1 changed files with 4 additions and 0 deletions
|
@ -60,6 +60,10 @@ pub struct Req<M: Message> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<M: Message> Req<M> {
|
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 {
|
pub fn with_stream_from_buffer(self, b: Bytes) -> Self {
|
||||||
Self {
|
Self {
|
||||||
stream: AttachedStream::Fixed(b),
|
stream: AttachedStream::Fixed(b),
|
||||||
|
|
Loading…
Reference in a new issue