mirror of
https://github.com/n0-computer/noq.git
synced 2026-09-19 01:36:08 +00:00
H3: make sending response error management more ergonomic
This commit is contained in:
@@ -246,13 +246,16 @@ where
|
||||
self
|
||||
}
|
||||
|
||||
pub fn send(self) -> Result<SendResponse, Error> {
|
||||
pub fn send(self) -> impl Future<Item = (), Error = Error> {
|
||||
let Sender {
|
||||
send,
|
||||
stream_id,
|
||||
conn,
|
||||
} = self.sender;
|
||||
SendResponse::new(self.response, self.trailers, send, stream_id, conn)
|
||||
match SendResponse::new(self.response, self.trailers, send, stream_id, conn) {
|
||||
Err(e) => Either::A(Err(e).into_future()),
|
||||
Ok(f) => Either::B(f),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn stream(self) -> impl Future<Item = BodyWriter, Error = Error> {
|
||||
|
||||
Reference in New Issue
Block a user